hgext/uncommit.py
changeset 51696 7f0cb9ee0534
parent 51686 493034cc3265
child 51699 ca7bde5dbafb
equal deleted inserted replaced
51695:bd1483fd7088 51696:7f0cb9ee0534
   152     """
   152     """
   153     cmdutil.check_note_size(opts)
   153     cmdutil.check_note_size(opts)
   154     cmdutil.resolve_commit_options(ui, opts)
   154     cmdutil.resolve_commit_options(ui, opts)
   155 
   155 
   156     with repo.wlock(), repo.lock():
   156     with repo.wlock(), repo.lock():
       
   157 
   157         st = repo.status()
   158         st = repo.status()
   158         m, a, r, d = st.modified, st.added, st.removed, st.deleted
   159         m, a, r, d = st.modified, st.added, st.removed, st.deleted
   159         isdirtypath = any(set(m + a + r + d) & set(pats))
   160         isdirtypath = any(set(m + a + r + d) & set(pats))
   160         allowdirtywcopy = opts[
   161         allowdirtywcopy = opts[
   161             'allow_dirty_working_copy'
   162             'allow_dirty_working_copy'
   261     marked as modified `hg status`)
   262     marked as modified `hg status`)
   262     """
   263     """
   263 
   264 
   264     unfi = repo.unfiltered()
   265     unfi = repo.unfiltered()
   265     with repo.wlock(), repo.lock(), repo.transaction(b'unamend'):
   266     with repo.wlock(), repo.lock(), repo.transaction(b'unamend'):
       
   267 
   266         # identify the commit from which to unamend
   268         # identify the commit from which to unamend
   267         curctx = repo[b'.']
   269         curctx = repo[b'.']
   268 
   270 
   269         rewriteutil.precheck(repo, [curctx.rev()], b'unamend')
   271         rewriteutil.precheck(repo, [curctx.rev()], b'unamend')
   270         if len(curctx.parents()) > 1:
   272         if len(curctx.parents()) > 1: