hgext/uncommit.py
changeset 34291 624c53e4121d
parent 34290 f94442d46984
child 34292 7b1e524ad73f
equal deleted inserted replaced
34290:f94442d46984 34291:624c53e4121d
    20 from __future__ import absolute_import
    20 from __future__ import absolute_import
    21 
    21 
    22 from mercurial.i18n import _
    22 from mercurial.i18n import _
    23 
    23 
    24 from mercurial import (
    24 from mercurial import (
       
    25     cmdutil,
    25     commands,
    26     commands,
    26     context,
    27     context,
    27     copies,
    28     copies,
    28     error,
    29     error,
    29     node,
    30     node,
   146     """
   147     """
   147 
   148 
   148     with repo.wlock(), repo.lock():
   149     with repo.wlock(), repo.lock():
   149         wctx = repo[None]
   150         wctx = repo[None]
   150 
   151 
       
   152         if not pats:
       
   153             cmdutil.bailifchanged(repo)
   151         if wctx.parents()[0].node() == node.nullid:
   154         if wctx.parents()[0].node() == node.nullid:
   152             raise error.Abort(_("cannot uncommit null changeset"))
   155             raise error.Abort(_("cannot uncommit null changeset"))
   153         if len(wctx.parents()) > 1:
   156         if len(wctx.parents()) > 1:
   154             raise error.Abort(_("cannot uncommit while merging"))
   157             raise error.Abort(_("cannot uncommit while merging"))
   155         old = repo['.']
   158         old = repo['.']