diff hgsubversion/svncommands.py @ 375:af9fc01299b4

Make branch closing more Mercurial-like. We now use the 'close' value from extra instead of the old closed-branches branch.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 29 May 2009 15:24:12 +0200
parents b45671850969
children 987bd7444f60
line wrap: on
line diff
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -111,11 +111,14 @@ def rebuildmeta(ui, repo, hg_repo_path, 
             assert False, 'Unhandled case in rebuildmeta'
         revmap.write('%s %s %s\n' % (revision, ctx.hex(), commitpath))
 
-        # deal with branches
         revision = int(revision)
         noderevnums[ctx.node()] = revision
         if revision > last_rev:
             last_rev = revision
+
+        # deal with branches
+        if ctx.extra().get('close'): # don't re-add, we just deleted!
+            continue
         branch = ctx.branch()
         if branch == 'default':
             branch = None
@@ -132,10 +135,10 @@ def rebuildmeta(ui, repo, hg_repo_path, 
                                   noderevnums.get(parent.node(), 0),
                                   revision)
 
-        # deal with branch closing
-        for c in ctx.children():
-            if c.branch() == 'closed-branches':
+        for cctx in ctx.children():
+            if cctx.extra().get('close'):
                 branchinfo.pop(branch, None)
+                break
 
     # save off branch info
     branchinfofile = open(os.path.join(svnmetadir, 'branch_info'), 'w')