##// END OF EJS Templates
uncommit: don't allow bare uncommit on dirty working directory...
Pulkit Goyal -
r34285:624c53e4 default
parent child Browse files
Show More
@@ -22,6 +22,7 b' from __future__ import absolute_import'
22 22 from mercurial.i18n import _
23 23
24 24 from mercurial import (
25 cmdutil,
25 26 commands,
26 27 context,
27 28 copies,
@@ -148,6 +149,8 b' def uncommit(ui, repo, *pats, **opts):'
148 149 with repo.wlock(), repo.lock():
149 150 wctx = repo[None]
150 151
152 if not pats:
153 cmdutil.bailifchanged(repo)
151 154 if wctx.parents()[0].node() == node.nullid:
152 155 raise error.Abort(_("cannot uncommit null changeset"))
153 156 if len(wctx.parents()) > 1:
@@ -149,6 +149,9 b' Uncommit with dirty state'
149 149 foo
150 150 $ hg status
151 151 M files
152 $ hg uncommit
153 abort: uncommitted changes
154 [255]
152 155 $ hg uncommit files
153 156 $ cat files
154 157 abcde
@@ -337,7 +340,7 b' Add and expect uncommit to fail on both '
337 340 (branch merge, don't forget to commit)
338 341
339 342 $ hg uncommit
340 abort: cannot uncommit while merging
343 abort: outstanding uncommitted merge
341 344 [255]
342 345
343 346 $ hg status
General Comments 0
You need to be logged in to leave comments. Login now