equal
deleted
inserted
replaced
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 |
|
158 st = repo.status() |
157 st = repo.status() |
159 m, a, r, d = st.modified, st.added, st.removed, st.deleted |
158 m, a, r, d = st.modified, st.added, st.removed, st.deleted |
160 isdirtypath = any(set(m + a + r + d) & set(pats)) |
159 isdirtypath = any(set(m + a + r + d) & set(pats)) |
161 allowdirtywcopy = opts[ |
160 allowdirtywcopy = opts[ |
162 'allow_dirty_working_copy' |
161 'allow_dirty_working_copy' |
262 marked as modified `hg status`) |
261 marked as modified `hg status`) |
263 """ |
262 """ |
264 |
263 |
265 unfi = repo.unfiltered() |
264 unfi = repo.unfiltered() |
266 with repo.wlock(), repo.lock(), repo.transaction(b'unamend'): |
265 with repo.wlock(), repo.lock(), repo.transaction(b'unamend'): |
267 |
|
268 # identify the commit from which to unamend |
266 # identify the commit from which to unamend |
269 curctx = repo[b'.'] |
267 curctx = repo[b'.'] |
270 |
268 |
271 rewriteutil.precheck(repo, [curctx.rev()], b'unamend') |
269 rewriteutil.precheck(repo, [curctx.rev()], b'unamend') |
272 if len(curctx.parents()) > 1: |
270 if len(curctx.parents()) > 1: |