Commit Graph

24 Commits

Author SHA1 Message Date
Jun Wu
ec32c2f725 histedit: use scmutil.cleanupnodes (BC)
This is marked as BC because the strip backup file name has changed.
2017-07-08 16:50:31 -07:00
Jun Wu
f9577750a4 histedit: unify strip backup files on success (BC)
Previously we wrote two different strip backup files on success. This patch
unifies them. It will make scmutil.cleanupnodes migration more smooth.
2017-07-08 16:50:31 -07:00
Jun Wu
e9417ea1fc histedit: remove moving bookmarks message on verbose (BC)
This is more consistent with other commands, like "commit -v" won't show
bookmark movement messages.

It will make migrating to scmutil.cleanupnodes easier.
2017-07-08 16:04:21 -07:00
Ben Schmidt
20f9183d45 histedit: modify rollup to discard date from the rollup commit (issue4820)
This change adjusts and documents the new behaviour of 'roll'. It now fits nicely
with the behaviour of 'commit --amend' and the 'edit' action, by discarding the
date as well as the commit message of the second commit. Previously it used the
later date, like 'fold', but this often wasn't desirable, for example, in the
common use case of using 'roll' to add forgotten changes to a changeset
(because 'hg add' was previously forgotten or not all changes were identified
while using 'hg record').
2017-02-18 21:30:28 +11:00
liscju
7a7ee3b559 histedit: adds hint how to reorder changesets at editor (issue3766) 2016-03-08 21:59:06 +01:00
timeless
84c6183618 histedit: prefer edit commit, edit message, use commit
Selecting editing commits, rewording commit messages, and
selecting commits are key actions, we will prefer them more
generally in a future commit, this pulls them ahead before
that to make the diffs easier to read.

The remaining commands are left alphabetically sorted
2015-12-23 21:20:08 +00:00
timeless
26fb25b6cd histedit: omit useless message from update (_histedit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:37:31 +00:00
Durham Goode
6c10065cf4 histedit: make histedit prune when obsolete is enabled
Back in June we made histedit use obsolete markers to cleanup when possible.
This was rolled back as part of bb3db0db4037 (which should have only rolled back
the --abort stuff, but rolled back everything). This caused a nasty bug when
used in conjuction with the inhibit+directaccess extensions where histedit would
leave old nodes around even after they had been squashed away.

The root of the problem is that we first clean up old nodes, and then we clean
up temp nodes. In the first pass, when we obsoleted old nodes, some would become
unobsolete because they had temp nodes on top of them, thus making them stick
around even after the histedit finished.

The fix is to A) move the temp node cleanup to be before the old node cleanup
(since they are topological on top of the old nodes), and B) use obsolete
markers instead of stripping.
2015-10-17 12:32:23 -07:00
timeless@mozdev.org
e88cb37448 histedit: improve discoverability of edit commit message 2015-08-28 15:50:36 -04:00
Durham Goode
cdb6754f26 histedit: convert fold/roll actions into a class
This converts the fold/roll actions into a histeditclass instance, as part of an
ongoing effort to refactor histedit for maintainability and robustness.

The tests changed for two reasons:

1) We get a new 'empty changeset' warning because we now warn more consistently
between normal histedit and --continue about commits disappearing.

2) Previously we were not putting the histedit-source extra field on the
temporary fold commit during normal runs, but we were on --continue runs. By
unifying these code paths we now consistently put histedit-source on the
temporary fold commit, which changes some of the hashes in the backup bundles.
2015-04-04 02:03:27 -07:00
Durham Goode
2591767a70 bundles: do not overwrite existing backup bundles (BC)
Previously, a backup bundle could overwrite an existing bundle and cause user
data loss. For instance, if you have A<-B<-C and strip B, it produces backup
bundle B-backup.hg. If you then hg pull -r B B-backup.hg and strip it again, it
overwrites the existing B-backup.hg and C is lost.

The fix is to add a hash of all the nodes inside that bundle to the filename.
Fixed up existing tests and added a new test in test-strip.t
2015-01-09 10:52:14 -08:00
Mike Edgar
fb41d0ff84 histedit: add "roll" command to fold commit data and drop message (issue4256)
This new histedit command (short for "rollup") is a variant of "fold" akin to
"hg amend" for working copy: it accumulates changes without interrupting
the user and asking for an updated commit message.
2014-08-06 16:51:41 -04:00
Matt Mackall
b35d905ff6 histedit: shorten new fold message
Lots of people, like Mr. Check-Code, insist on using 80-column terminals.
2014-02-15 19:12:53 -06:00
Adrian Zgorzałek
4f40289598 histedit: clarify description of fold command
N and (N-1) didn't add any information to description of fold.
More useful is refering to the commit list as it is displayed in editor.
2014-02-13 18:05:35 -08:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Pierre-Yves David
6397296e45 histedit-test: generalise --commands "-" usage
This is simpler than temporary file version. There some minor test
changes since commit messages are no longer modifed. There is still
some tests using --commands with a real file.
2013-04-16 21:57:25 -05:00
Pierre-Yves David
5bda497c6d histedit: record histedit source (issue3681)
Have histedit record the hex of the original changeset as already done by:
- graft
- commit --amend
- rebase

My main motivation for adding this is to prevent the creation of obsolescence cycle
(see issue3681).

Note that commit created during edit are not affected yet.
2013-01-16 19:14:22 +01:00
Mads Kiilerich
b76126725e histedit: process bookmarks in sorted order 2012-12-12 02:38:14 +01:00
Pierre-Yves David
c922450686 histedit: replace various nodes lists with replacement graph (and issue3582)
This changeset rewrites the change tracking logic of histedit to record every
operation it does. Tracked operations record the full list of "old" node that
will eventually be removed to the list of new nodes that replace it. Operations
on temporary nodes are tracked too. Dropped changesets are also recorded as an
"old" node replacement by nothing. This logic is similar to the obsolescence
marker one and will be used for this purpose in later commit.

This new logic implies a big amount of change in the histedit code base.

histedit action functions now always return a tuple of

    (new-ctx, [list of rewriting operations])

The old `created`, `replaced` and `tmpnodes` are no longer returned and stored
during histedit operation. When such information is necessary it is computed
from the replacement graph. This computation is done in the `processreplacement`
function.

The `replacemap` is also dropped. It is computed at the end of the command from the
graph.  The `bootstrapcontinue` methods are altered to compute this different kind of
information.

This new mechanism requires much less information to be written on disk.

Note:

    This changes allows a more accurate bookmark movement. bookmark on dropped
    changeset are now move of their parent (or replacement of their parent)
    instead of their children.

    This fix issue3582
2012-10-11 08:36:50 +02:00
Pierre-Yves David
8b8b1a2322 histedit: update bookmark movement notice
New format is:

    histedit: moving bookmarks <bookmark> from <old> to <new>
2012-10-10 05:54:38 +02:00
Mads Kiilerich
e1e9922b2d tests: make histedit pass on Windows MSYS
The command file will now be named with $TESTTMP (with '\') instead of `pwd`
(with '/') to avoid wrong path conversions.
2012-07-02 01:47:59 +02:00
Mads Kiilerich
7c32277ff3 histedit: use stable iteration order for processing bookmarks
Random dict iteration order caused test failure in
test-histedit-bookmark-motion.t.
2012-06-30 03:34:41 +02:00
Augie Fackler
533a952be8 histedit tests: fix check-code problems 2012-06-27 18:34:31 -05:00
Augie Fackler
526a183684 histedit: new extension for interactive history editing 2012-06-27 17:52:54 -05:00