changeset 1028:c4b25a903ad3

layouts: consistently return None for default branch This makes the single and standard layouts consistent in what they return for the default branch. Previously, single had returned 'default' now they both return None. In addition, this fixes a now-exposed bug in stupid's convert_revision logic. Specifically, when a file is replaced by another file within the same branch, we treated that as replacing the entire branch. this bug was previously hidden because meta.split_branch_path and meta.localname were inconsistent in what they returned for the single layout. meta.split-branch_path is used to maintain the set of known branches, where meta.localname is used to determine the branch for the path being replaced. This resulted in erroneously hitting the condition that skipped paths outside branches we know about when considering replace operations from svn.
author David Schleimer <dschleimer@fb.com>
date Wed, 05 Jun 2013 11:00:06 -0700
parents 16045f6f3fef
children 513f2b607b06
files hgsubversion/layouts/single.py hgsubversion/stupid.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/layouts/single.py
+++ b/hgsubversion/layouts/single.py
@@ -6,7 +6,7 @@ class SingleLayout(base.BaseLayout):
     """A layout with only the default branch"""
 
     def localname(self, path):
-        return 'default'
+        return None
 
     def remotename(self, branch):
         return ''
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -722,9 +722,9 @@ def convert_rev(ui, meta, svn, r, tbdelt
                     r.revnum, branch, exact=True)]
                 if util.isancestor(pctx, fromctx):
                     continue
-        closed = checkbranch(meta, r, branch)
-        if closed is not None:
-            deleted_branches[branch] = closed
+            closed = checkbranch(meta, r, branch)
+            if closed is not None:
+                deleted_branches[branch] = closed
 
     date = meta.fixdate(r.date)
     check_deleted_branches = set(tbdelta['branches'][1])