Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 41397:0bd56c291359
cleanup: use p1() and p2() instead of parents()[0] and parents()[1]
We have had these methods on both contexts and dirstate for a long
time now.
Differential Revision: https://phab.mercurial-scm.org/D5706
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 25 Jan 2019 23:36:23 -0800 |
parents | 2f2a7ea62e9a |
children | 2ff8994ac71d |
comparison
equal
deleted
inserted
replaced
41396:3461814417f3 | 41397:0bd56c291359 |
---|---|
1670 extra['close'] = '1' | 1670 extra['close'] = '1' |
1671 | 1671 |
1672 if not bheads: | 1672 if not bheads: |
1673 raise error.Abort(_('can only close branch heads')) | 1673 raise error.Abort(_('can only close branch heads')) |
1674 elif opts.get('amend'): | 1674 elif opts.get('amend'): |
1675 if repo[None].parents()[0].p1().branch() != branch and \ | 1675 if repo[None].p1().p1().branch() != branch and \ |
1676 repo[None].parents()[0].p2().branch() != branch: | 1676 repo[None].p1().p2().branch() != branch: |
1677 raise error.Abort(_('can only close branch heads')) | 1677 raise error.Abort(_('can only close branch heads')) |
1678 | 1678 |
1679 if opts.get('amend'): | 1679 if opts.get('amend'): |
1680 if ui.configbool('ui', 'commitsubrepos'): | 1680 if ui.configbool('ui', 'commitsubrepos'): |
1681 raise error.Abort(_('cannot amend with ui.commitsubrepos enabled')) | 1681 raise error.Abort(_('cannot amend with ui.commitsubrepos enabled')) |