# HG changeset patch # User David Schleimer # Date 1370455206 25200 # Node ID c4b25a903ad3f1afb52b3ed05bf5a2438ebe75a4 # Parent 16045f6f3fef948f5d19c69bf31c41dd4691a1d6 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. diff --git a/hgsubversion/layouts/single.py b/hgsubversion/layouts/single.py --- 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 '' diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- 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])