Commit Graph

292 Commits

Author SHA1 Message Date
Mateusz Kwapich
36f23adcb5 histedit: add a hint about enabled dropmissing to histedit edit comment
Adds a hint to histedit comment reminding user about enabled dropmissing.
This will make the enabled dropmissing more visible. The example comment:

# Edit history between 5abd0a5c28d1 and b54649a8a63f
#
# Commits are listed from least to most recent
#
# You can reorder changesets by reordering the lines
#
# Commands:
#
#  e, edit = use commit, but stop for amending
#  m, mess = edit commit message without changing commit content
#  p, pick = use commit
#  b, base = checkout changeset and apply further changesets from there
#  d, drop = remove commit from history
#  f, fold = use commit, but combine it with the one above
#  r, roll = like fold, but discard this commit's description
#
# Deleting a changeset from the list will DISCARD it from the edited history!
2016-03-19 11:39:13 -07:00
Jun Wu
745b527cb7 histedit: do not close stdin
Closing stdin is unexpected by chgserver and is not a good idea generally.
This patch refactors related code a bit and make sure stdin is not closed.
It will make chg much happier on test-histedit*.t.
2016-03-15 00:42:33 +00:00
Mateusz Kwapich
812fb817e3 histedit: have dropmissing abort on empty plan
We noticed that many users have the intuition of laving the editor empty when
they want to abort the operation. The fact that dropmissing allows user to
delete all edited commits is not intuitive even for users that asked for it.

Let's prevent people from this footgun.
2016-03-13 16:46:49 -07:00
liscju
7a7ee3b559 histedit: adds hint how to reorder changesets at editor (issue3766) 2016-03-08 21:59:06 +01:00
timeless
6b7ebe1ed5 histedit: reword message when a changeset produces no changes
There are various ways to use histedit such that an item in
the list of things to perform will not result in a change
relative to the previous repository state.

When that happens, histedit does not keep the commit/message.

This changes the note to try to explain to the user that it
will not be present in their history.
2016-03-02 22:39:03 +00:00
liscju
7a22f98665 histedit: improve error when run on nodes with children (issue5056) 2016-02-29 15:12:26 +01:00
Pierre-Yves David
7d58576c3b histedit: also handle locally missing nodes when reading obsolescence
The previous version of the code was interpreting markers to a missing
node as a prune in all cases. The expected way to handle such
situation is to keep reading markers, only turning successors into
"prune" if they are at the end of a chain.

We update the code and add a test for this.
2016-02-24 16:58:07 +01:00
Kostia Balytskyi
4b4261dc2f histedit: make histedit aware of obsolescense not stored in state (issue4800)
Before this change, when histedit exited to interactive session (during edit
command for example), user could introduce obsolescence markers that would not
be known to histedit. For example, user could've amended one of the commits.
The fact of this amendment would not be stored in histedit's state file
and later, when histedit would try to process all the replacements,
one of the final successors (in histedit's opinion) would turn out to be hidden.
This behavior is described in issue4800. This commit fixes it.
2016-02-23 21:38:36 +00:00
Kostia Balytskyi
7b6b233a86 histedit: unifying the way replacements are computed for abort and success
This is a part of a bigger refactoring effort with the ultimate goal of
better understanding of how histedit works and fixing issue4800.
2016-02-16 14:49:29 +00:00
Kostia Balytskyi
f0666adeb0 histedit: renaming parts to which _histedit was split
I recently broke _histedit into multiple functions, each of which
had 'action' in its name. This is a little bit confusing since 'action'
is the word for an individual histedit plan item (such as edit or pick).
To avoid this confusion, these functions are now renamed to contain
'histedit' as part of their names.
2016-02-15 14:57:06 +00:00
Kostia Balytskyi
6f752dbaad histedit: break _histedit into smaller pieces (add _finishaction)
This is a part of a bigger effort to refactor histedit with ultimate
goal of understanding it.
2016-02-15 12:07:33 +00:00
Kostia Balytskyi
a41792ba9d histedit: change string literals to constants in goal naming
This is a part of bigger effort to refactor histedit with ultimate
goal of understanding it.
2016-02-15 10:48:36 +00:00
Kostia Balytskyi
41ac3675d5 histedit: break _histedit function into smaller pieces
We add _getgoal, _validateargs.

This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix issue4800.
2016-02-14 21:15:59 +00:00
Kostia Balytskyi
c6f4a6c3fa histedit: break _histedit function into smaller pieces (add _continueaction)
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix issue4800.
2016-02-14 21:00:05 +00:00
Kostia Balytskyi
7860d98cbb histedit: break _histedit function into smaller pieces (add _newaction)
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix issue4800.
2016-02-01 17:20:51 +00:00
Kostia Balytskyi
2691d2b5da histedit: break _histedit function into smaller pieces (add _editplanaction)
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix issue4800.
2016-02-01 14:12:38 +00:00
Kostia Balytskyi
94524de837 histedit: break _histedit function into smaller pieces (add _abortaction)
This is a part of bigger effort to refactor histedit. Initial steps are to
break _histedit function into smaller pieces which will supposedly be more
understandable. After this is done, I will have a better understanding
of how histedit works and apply that to fix issue4800.
2016-02-01 12:51:20 +00:00
timeless
8f5f0dd31d histedit: suggest the correct tool to continue (not histedit)
Suggest committing (or whatever the current activity is), via
wrongtooltocontinue which uses howtocontinue.
2016-02-04 03:47:00 +00:00
FUJIWARA Katsunori
5875073363 doc: describe full help document hierarchy to create a valid link in HTML
For example, ":hg:`help config.default-push`" creates an invalid link
to "hgrc.5.html#default-push" in HTML, but ":hg:`help
config.paths.default-push`" creates a valid link to
"hgrc.5.html#paths".
2016-02-11 23:15:34 +09:00
timeless
f1102ce465 histedit: limit updated and merging output to important updates
Output is retained when:
* There's a conflict
* User asked to edit
* User aborts

otherwise, output is suppressed
2016-02-03 13:52:04 +00:00
Wagner Bruna
de70b03c22 histedit: fix typo in documentation 2016-02-03 11:01:11 -02:00
FUJIWARA Katsunori
c6d9f4c401 doc: use correct cross reference in help documentation
This patch fixes problems below:

  - ":hg:" role should be followed by not '"' but '`'
  - there is a help topic not "default-push" but "config.default-push"
2016-02-01 22:13:57 +09:00
FUJIWARA Katsunori
6a03d4f576 doc: prevent literal text block from being treated as non-literal one
This creates hg.1.html as expected.
2016-02-01 22:06:35 +09:00
FUJIWARA Katsunori
901d78d859 doc: prevent non-literal text block from being treated as literal one
This creates hg.1.html as expected.
2016-02-01 22:06:35 +09:00
FUJIWARA Katsunori
a189f9751b histedit: show correct hash ID at verification error
node.short() on 'ha' in verifyactions() causes broken hash ID, because
it is initialized with node.hex()-ed node value.
2016-02-01 20:29:20 +09:00
Bryan O'Sullivan
8c6b71c1ce with: use context manager in _histedit 2016-01-15 13:14:49 -08:00
Bryan O'Sullivan
2ced15165a with: use context manager for lock in histedit cleanupnode 2016-01-15 13:14:47 -08:00
timeless
c5e6ac2fdd histedit: clarify modes
also fix terse command syntax
2015-12-23 06:36:47 +00:00
timeless
6e7d73e833 histedit: explain basics of histedit commands
This should be hooked into @action via an extended
help argument, but that is future work.
2015-12-22 23:21:53 +00:00
timeless
f130e904b6 histedit: report the unacceptable changeset 2015-12-23 07:37:45 +00:00
timeless
37bdcf185f histedit: replace @addhisteditaction with @action
@action supports verbs, messages, priority, and internal

messages should be translated.
internal means the action should not be listed.

geteditcomment will construct the verbs list based on
@actions (prefering priority over non priority, otherwise
favoring verbs with short forms over verbs without).
2015-12-23 21:30:38 +00: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
3b48ba0db9 histedit: replace editcomment with a function 2015-12-23 21:17:45 +00:00
timeless
4ac12a9abc histedit: hide --outgoing warnings 2015-12-22 23:25:17 +00:00
timeless
c5945ca9d0 histedit: list action when intervention is required 2015-12-23 08:57:04 +00:00
timeless
cc8aba7ca7 histedit: hook afterresolvedstates 2015-12-24 20:41:17 +00:00
timeless
bc013751ae histedit: fix comment in newnodestoabort 2015-12-30 04:04:51 +00:00
timeless
f7a4033ef1 histedit: fix comment in applychanges 2015-12-30 04:02:04 +00:00
timeless
4c1b57259a histedit: remove unused variable state 2015-12-31 15:39:38 +00:00
timeless
303f2b32c3 histedit: handle exceptions from node.bin in fromrule 2015-12-23 23:51:29 +00:00
timeless
2e291bf611 histedit: limit cleanup of histedit-last-edit.txt to success 2015-12-23 23:23:28 +00:00
timeless
f32fa41604 histedit: use parse-error exception for parsing 2015-12-27 03:33:09 +00:00
timeless
81170df509 histedit: limit mentioning histedit-last-edit.txt
Before histedit-last-edit.txt would be mentioned for any failure.
After, it should only be mentioned for failures relating to user
input.
2015-12-11 07:08:09 +00:00
timeless
d96f3f0401 histedit: check fold of public change during verify 2015-12-28 22:53:22 +00:00
timeless
9a911bf754 histedit: pass previous action to verify 2015-12-28 22:52:48 +00:00
Bryan O'Sullivan
dd14bb51a5 histedit: don't bother with cPickle, demand-load pickle
We're unlikely to ever need the pickle module, so there's no good
reason to force loading of its faster cousin.
2015-12-23 16:22:20 -08:00
Bryan O'Sullivan
9c2d540690 histedit: only use pickle if not using the modern save format
This avoids a case where PyPy's cPickle module throws a more confusing
error than CPython's.
2015-12-27 23:55:54 +09:00
timeless
4d95bd2b9d histedit: add progress support 2015-12-18 06:19:22 +00:00
Mateusz Kwapich
011f0f625e histedit: delete to drop
The default behaviour to forbid this makes a lot of sense for novice users
because it's safeguarding them from dangerous behavior but making it
configurable will be apprieciated by power users in at least one big
organization.

It allows an user to look an histedit rules from declarative perspective and
make the rules reflect the state after histedit.  If we can move lines t move
commits why can't we drop lines to drop commits?

Let's put this behind config knob and inform users about this feature the very
moment they are trying to use it so they can choose desired behaviour.
2015-12-15 13:27:09 -08:00
timeless
2abe9172f6 histedit: omit useless message from update (edit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:04:17 +00:00