-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Description
Using the command-line adapter, I sometimes get incorrect results when requesting
getInfoFromWorkingCopy for a directory that contains both managed and unmanaged
entries.
In the implementation, the code first gets status information for the path, which
returns status information of all directory entries. The implementation then
incorrectly assumes the first entry is the directory itself. This is not true for
subversion v1.4.5.
Metadata Imported from Tigris (Issue 1264)
- Creation Date: 2011-04-27 04:21:51
- Reporter: bartvh
- Subcomponent: svnClientAdapter
- Version: 1.1.x
- Milestone: not determined
- Keywords:
- Cc:
Comments
2011-04-27 04:23:09 by bartvh
Created an attachment (id=342)
proposed patch that will check all results instead of only the first one
Attachments
client-1.4-info.patch - proposed patch that will check all results instead of only the first one
Posted 2011-04-27 04:23:09 by bartvh
Index: src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java
===================================================================
--- src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java (revision 4859)
+++ src/commandline/org/tigris/subversion/svnclientadapter/commandline/CmdLineClientAdapter.java (working copy)
@@ -1286,12 +1286,17 @@
// first we get the status of the files to find out whether it is versioned
CmdLineStatusPart[] cmdLineStatusParts = getCmdStatuses(new File[] {path}, false, true, false, false);
// if the file is managed, it is safe to call info
- if ((cmdLineStatusParts.length > 0) && (cmdLineStatusParts[0].isManaged())) {
- String cmdLineInfoStrings = _cmd.info(new String[] { toString(path) }, null, null);
- return new CmdLineInfoPart(cmdLineInfoStrings);
- } else {
- return CmdLineInfoPart.createUnversioned(path.getPath());
+ for (int i = 0; i < cmdLineStatusParts.length; i++) {
+ if (cmdLineStatusParts[i].getPath().equals(path.getPath())) {
+ if (cmdLineStatusParts[i].isManaged()) {
+ String cmdLineInfoStrings = _cmd.info(new String[] { toString(path) }, null, null);
+ return new CmdLineInfoPart(cmdLineInfoStrings);
+ } else {
+ return CmdLineInfoPart.createUnversioned(path.getPath());
+ }
+ }
}
+ return CmdLineInfoPart.createUnversioned(path.getPath());
} catch (CmdLineException e) {
throw SVNClientException.wrapException(e);
}