transplant: use bailifchanged() instead of reimplementing it
Differential Revision: https://phab.mercurial-scm.org/D5691
--- a/hgext/transplant.py Thu Jan 24 12:47:54 2019 -0800
+++ b/hgext/transplant.py Thu Jan 24 16:16:10 2019 -0800
@@ -676,11 +676,7 @@
raise error.Abort(_('no transplant to continue'))
else:
cmdutil.checkunfinished(repo)
- if p2 != revlog.nullid:
- raise error.Abort(_('outstanding uncommitted merges'))
- m, a, r, d = repo.status()[:4]
- if m or a or r or d:
- raise error.Abort(_('outstanding local changes'))
+ cmdutil.bailifchanged(repo)
sourcerepo = opts.get('source')
if sourcerepo:
--- a/tests/test-transplant.t Thu Jan 24 12:47:54 2019 -0800
+++ b/tests/test-transplant.t Thu Jan 24 16:16:10 2019 -0800
@@ -39,12 +39,12 @@
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg transplant 1
- abort: outstanding uncommitted merges
+ abort: outstanding uncommitted merge
[255]
$ hg up -qC tip
$ echo b0 > b1
$ hg transplant 1
- abort: outstanding local changes
+ abort: uncommitted changes
[255]
$ hg up -qC tip
$ echo b2 > b2