transplant: use bailifchanged() instead of reimplementing it
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 24 Jan 2019 16:16:10 -0800
changeset 41393 608c15f76f50
parent 41392 a728ef2f9b15
child 41394 390ef056081b
transplant: use bailifchanged() instead of reimplementing it Differential Revision: https://phab.mercurial-scm.org/D5691
hgext/transplant.py
tests/test-transplant.t
--- 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