comparison CHANGELOG @ 4821:d8e36e60aea0

rewind: add --keep flag that "doesn't modify working directory" The actual logic is more complicated than the flag description, but it's sufficiently similar to other --keep flags in action. Unlike strip (or prune), rewind always needs to modify the working directory to commit new revisions that "revive" old ones [1], see _revive_revision() (and rewriteutil.rewrite()). Because of that we don't prevent rewind from modifying wdir, but instead use hg.updaterepo() to update to the old changeset after the "revival" process is complete. Then we rebuild the dirstate based on the commit that rewind would update to without --keep. Since dirstate.rebuild() doesn't restore status of some files (added, removed, also copies and renames), we rely on cmdutil.revert(). It's a fairly crude solution and needs to be removed when implementing the missing copy tracing between oldctx and newctx (which are related only by obsolescence). [1] IOW this means that --keep doesn't allow rewinding if wdir is dirty (unlike e.g. strip).
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 25 Jul 2019 18:37:16 +0800
parents 316d910df72c
children 4c6dd20e8cc2
comparison
equal deleted inserted replaced
4820:d842a4c6fc4a 4821:d8e36e60aea0
1 Changelog 1 Changelog
2 ========= 2 =========
3 3
4 9.1.0 - in progress 4 9.2.0 - in progress
5 ------------------- 5 -------------------
6 6
7 * python3: beta support for Python 3.6+ 7 * python3: beta support for Python 3.6+
8 (thanks to ludovicchabant, martinvonz and rgomes for their hard work) 8 (thanks to ludovicchabant, martinvonz and rgomes for their hard work)
9 * prune: clarify error message when no revision were passed, 9 * prune: clarify error message when no revision were passed,
10 * evolve: avoid possible race conditions bu locking earlier 10 * evolve: avoid possible race conditions bu locking earlier
11 * abort: add support for `evolve` and `pick` to `hg abort` (hg-5.1+) 11 * abort: add support for `evolve` and `pick` to `hg abort` (hg-5.1+)
12 * rewind: add --keep flag to preserve working copy
12 13
13 9.1.0 -- 2019-07-29 14 9.1.0 -- 2019-07-29
14 ------------------- 15 -------------------
15 16
16 * compatibility with upcoming Mercurial 5.1, 17 * compatibility with upcoming Mercurial 5.1,