##// END OF EJS Templates
cmdutil: make bail_if_changed bail on uncommitted merge
Matt Mackall -
r5716:be367cba default
parent child Browse files
Show More
@@ -64,6 +64,8 b' def findcmd(ui, cmd, table):'
64 64 raise UnknownCommand(cmd)
65 65
66 66 def bail_if_changed(repo):
67 if repo.dirstate.parents()[1] != nullid:
68 raise util.Abort(_('outstanding uncommitted merge'))
67 69 modified, added, removed, deleted = repo.status()[:4]
68 70 if modified or added or removed or deleted:
69 71 raise util.Abort(_("outstanding uncommitted changes"))
@@ -196,11 +196,9 b' def backout(ui, repo, node=None, rev=Non'
196 196 raise util.Abort(_("please specify a revision to backout"))
197 197
198 198 cmdutil.bail_if_changed(repo)
199 node = repo.lookup(rev)
200
199 201 op1, op2 = repo.dirstate.parents()
200 if op2 != nullid:
201 raise util.Abort(_('outstanding uncommitted merge'))
202 node = repo.lookup(rev)
203
204 202 a = repo.changelog.ancestor(op1, node)
205 203 if a != node:
206 204 raise util.Abort(_('cannot back out change on a different branch'))
General Comments 0
You need to be logged in to leave comments. Login now