diff mercurial/commands.py @ 16720:e825a89de5d7

context: add changectx.closesbranch() method This removes the duplicated code for inspecting the 'close' extra field in a changeset.
author Brodie Rao <brodie@sf.io>
date Sun, 13 May 2012 14:04:06 +0200
parents e7bf09acd410
children 3e6d59ae4dc2
line wrap: on
line diff
--- a/mercurial/commands.py	Sun May 13 14:04:04 2012 +0200
+++ b/mercurial/commands.py	Sun May 13 14:04:06 2012 +0200
@@ -1349,7 +1349,7 @@
 
     if not opts.get('close_branch'):
         for r in parents:
-            if r.extra().get('close') and r.branch() == branch:
+            if r.closesbranch() and r.branch() == branch:
                 ui.status(_('reopening closed branch head %d\n') % r)
 
     if ui.debugflag:
@@ -5414,7 +5414,7 @@
         t += _(' (merge)')
     elif branch != parents[0].branch():
         t += _(' (new branch)')
-    elif (parents[0].extra().get('close') and
+    elif (parents[0].closesbranch() and
           pnode in repo.branchheads(branch, closed=True)):
         t += _(' (head closed)')
     elif not (st[0] or st[1] or st[2] or st[3] or st[4] or st[9]):