]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Better heuristic for checking for hgsubversion
authordurham <durham@fb.com>
Fri, 23 Aug 2013 23:40:15 +0000 (16:40 -0700)
committerdurham <durham@fb.com>
Fri, 23 Aug 2013 23:40:15 +0000 (16:40 -0700)
Summary:
The existing heuristic checks for the existence of .hg/svn, but it
turns out that this directory can exist in a non-svn hg repo if the user or a
script ever runs a 'hg svn' command.

Now we check for a file inside .hg/svn.  The hgsubversion maintainer said this
particular file will always be present in hgsubversion repos.

Test Plan:
arc land --trace
Verified it used 'hg push' and not 'hg push -r ...'. This indicates it
considered the repo to be an hgsubversion repo.

Reviewers: epriestley

Reviewed By: epriestley

CC: dschleimer, sid0, Korvin, aran
Differential Revision: https://secure.phabricator.com/D6807

src/repository/api/ArcanistMercurialAPI.php

index 0029c3180d0a42b26f5cbd3b4a537ff5233ef616..2d7484a836e5a5108654bf207d55cb39509339b0 100644 (file)
@@ -917,7 +917,7 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI {
   }
 
   public function isHgSubversionRepo() {
-    return file_exists($this->getPath('.hg/svn'));
+    return file_exists($this->getPath('.hg/svn/rev_map'));
   }
 
   public function getSubversionInfo() {