Commit Graph

281 Commits

Author SHA1 Message Date
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
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
timeless
5551448efc histedit: omit useless message from update (histeditaction)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 21:43:16 +00:00
timeless
0853af047a histedit: omit useless message from abort
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:08:14 +00:00
Augie Fackler
0a19647501 merge: have merge.update use a matcher instead of partial fn
This is relatively rarely used functionality, but migrating this to a
matcher will make future work on narrow clones more feasible.
2015-12-14 18:54:03 -05:00
Gregory Szorc
0c976d1ad3 histedit: pick an appropriate base changeset by default (BC)
Previously, `hg histedit` required a revision argument specifying which
revision to use as the base for the current histedit operation. There
was an undocumented and experimental "histedit.defaultrev" option that
supported defining a single revision to be used if no argument is
passed.

Mercurial knows what changesets can be edited. And in most scenarios,
people want to edit this history of everything on the current head that
is rewritable. Making histedit do this by default and not require
an explicit argument or additional configuration is a major usability
win and will enable more people to use histedit.

This patch changes the behavior of the experimental and undocumented
"histedit.defaultrev" config option to select an appropriate base
revision by default. Comprehensive tests exercising the edge cases
in the new, somewhat complicated default revset have been added.
Surprisingly, no tests broke. I guess we were never testing the
behavior with no ANCESTOR argument (it used to fail with
"abort: histedit requires exactly one ancestor revision"). The new
behavior is much more user friendly.

The functionality for choosing the default base revision has been
moved to destutil.py, where it can easily be modified by extensions.
2015-10-24 19:56:39 +01:00
timeless
538843243e histedit: improve missing rule suggestion
include actual suggested text
2015-12-02 07:41:35 +00:00
Mateusz Kwapich
0016ccb3cd histedit: get rid of state.rules
Now we are using state.actions instead of state.rules everywhere.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
eb6e47fe5e histedit: change state.rules uses to state.actions
This change is replacing most of state.rules uses with state.actions
uses. The next change will change histeditstate class to actually
uses state actions.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
45bd81cd16 histedit: add tostate method to histedit action
the format of rules that we store in state file format is different from the rule
format that we present to users. We need a way of dumping action to state file.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
5cf03a9c5a histedit: remove makedesc
It's a dead code now.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
574ed39bd6 histedit: use torule instead of makedesc in ruleeditor 2015-12-02 12:19:01 -08:00