Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometimes incorrect results for getInfoFromWorkingCopy under subversion 1.4.5 [Tigris #1264] #15

Open
markphip opened this issue Sep 15, 2016 · 0 comments
Labels

Comments

@markphip
Copy link
Contributor

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);
         }        
@markphip markphip added the patch label Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant