comparison 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
comparison
equal deleted inserted replaced
16719:e7bf09acd410 16720:e825a89de5d7
1347 # 1347 #
1348 # HH n head merge: head count decreases 1348 # HH n head merge: head count decreases
1349 1349
1350 if not opts.get('close_branch'): 1350 if not opts.get('close_branch'):
1351 for r in parents: 1351 for r in parents:
1352 if r.extra().get('close') and r.branch() == branch: 1352 if r.closesbranch() and r.branch() == branch:
1353 ui.status(_('reopening closed branch head %d\n') % r) 1353 ui.status(_('reopening closed branch head %d\n') % r)
1354 1354
1355 if ui.debugflag: 1355 if ui.debugflag:
1356 ui.write(_('committed changeset %d:%s\n') % (int(ctx), ctx.hex())) 1356 ui.write(_('committed changeset %d:%s\n') % (int(ctx), ctx.hex()))
1357 elif ui.verbose: 1357 elif ui.verbose:
5412 5412
5413 if len(parents) > 1: 5413 if len(parents) > 1:
5414 t += _(' (merge)') 5414 t += _(' (merge)')
5415 elif branch != parents[0].branch(): 5415 elif branch != parents[0].branch():
5416 t += _(' (new branch)') 5416 t += _(' (new branch)')
5417 elif (parents[0].extra().get('close') and 5417 elif (parents[0].closesbranch() and
5418 pnode in repo.branchheads(branch, closed=True)): 5418 pnode in repo.branchheads(branch, closed=True)):
5419 t += _(' (head closed)') 5419 t += _(' (head closed)')
5420 elif not (st[0] or st[1] or st[2] or st[3] or st[4] or st[9]): 5420 elif not (st[0] or st[1] or st[2] or st[3] or st[4] or st[9]):
5421 t += _(' (clean)') 5421 t += _(' (clean)')
5422 cleanworkdir = True 5422 cleanworkdir = True