Mercurial > hg
comparison mercurial/context.py @ 44365:7c4b98a4e536
copy: add experimetal support for unmarking committed copies
The simplest way I'm aware of to unmark a file as copied after
committing is this:
hg uncommit --keep <dest>
hg forget <dest>
hg add <dest>
hg amend
This patch teaches `hg copy --forget` a `-r` argument to simplify that into:
hg copy --forget --at-rev . <dest>
In addition to being simpler, it doesn't touch the working copy, so it
can easily be used even if the destination file has been modified in
the working copy.
I'll teach `hg copy` without `--forget` to work with `--at-rev` next.
Differential Revision: https://phab.mercurial-scm.org/D8030
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 28 Jan 2020 14:07:57 -0800 |
parents | 2e2cfc3bea0b |
children | e607099d8b93 4234c9af515d |
comparison
equal
deleted
inserted
replaced
44364:8be0c63535b5 | 44365:7c4b98a4e536 |
---|---|
2485 user=user, | 2485 user=user, |
2486 branch=branch, | 2486 branch=branch, |
2487 editor=editor, | 2487 editor=editor, |
2488 ) | 2488 ) |
2489 | 2489 |
2490 def tomemctx_for_amend(self, precursor): | |
2491 extra = precursor.extra().copy() | |
2492 extra[b'amend_source'] = precursor.hex() | |
2493 return self.tomemctx( | |
2494 text=precursor.description(), | |
2495 branch=precursor.branch(), | |
2496 extra=extra, | |
2497 date=precursor.date(), | |
2498 user=precursor.user(), | |
2499 ) | |
2500 | |
2490 def isdirty(self, path): | 2501 def isdirty(self, path): |
2491 return path in self._cache | 2502 return path in self._cache |
2492 | 2503 |
2493 def isempty(self): | 2504 def isempty(self): |
2494 # We need to discard any keys that are actually clean before the empty | 2505 # We need to discard any keys that are actually clean before the empty |