]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix issue with svn-hook-pre-commit when resolving .arcconfig for nested
authorepriestley <epriestley@phabricator.com>
Sat, 5 Mar 2011 08:42:46 +0000 (00:42 -0800)
committerepriestley <epriestley@phabricator.com>
Sat, 5 Mar 2011 08:49:52 +0000 (00:49 -0800)
directories

Summary:
If you had changes to a directory covered by a .arcconfig residing
inside another directory also covered by an .arcconfig, the hook would
incorrectly attribute the first file it attempted to resolve to the topmost
.arcconfig because it failed to break out of the loop after resolving it.

All other files would be correctly attributed, because they'd hit the cache.

Test Plan:
Created an svn repository and checked it out locally. Created a
structure like this:

  .arcconfig
  shallow
  a/
   b/
    c/
     .arcconfig
     d/
      deep
      deep2
      deep3

Made modifications to "deep", "deep2", and "deep3". Received an error message
about multiple .arcconfig changes, attributing one file to the topmost
arcconfig and the other two to the deeper one.

Applied patch.

Commit now goes through. Made a commit affecting 'shallow' and 'deep' and
'deep2', commit was correctly blocked and files were attributed to the
corresponding .arcconfigs.

Reviewed By: mroch
Reviewers: mroch
CC: mroch
Differential Revision: 50

src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php

index f0caaefb1eeecbe10ea7fde90b5a5ece21c12cae..5325c922de3e8244dd59e6deda9c94bb36aa1122 100644 (file)
@@ -114,6 +114,7 @@ EOTEXT
         } else {
           $resolved[$path] = $config ? $config.'/.arcconfig' : '.arcconfig';
           $found[$config] = $resolved[$path];
+          break;
         }
         $config = dirname($config);
         if ($config == '.') {