Commit Graph

5221 Commits

Author SHA1 Message Date
timeless
32124ab7e3 rebase: mention conflict in documentation instead of merge 2015-12-18 18:32:15 +00:00
timeless
a11d42f514 rebase: simplify documentation about heads 2015-12-18 18:31:45 +00:00
timeless
99e9c1b2d0 rebase: simplify documentation about --keep
Also include a warning about bookmarks
2015-12-18 18:22:03 +00:00
timeless
30016e92bc rebase: simplify documentation about selecting commits to rebase 2015-12-18 18:24:41 +00:00
timeless
16c4277abb rebase: simplify documentation about public commits
add reference to graft
2015-12-18 18:06:43 +00: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
Mathias De Maré
0e11ed0ee2 clonebundles: fix bundlespec typo 2015-12-16 12:33:54 +01: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
Gregory Szorc
120d4eb9b6 share: pass named arguments
They are defined as named arguments and previous called as positional
arguments. As part of wrapping hg.share in an extension, I had to
extract arguments using some hacky techniques. Using named arguments
makes wrapping much simpler.
2015-12-12 22:07:40 -05:00
Mathias De Maré
14d32d90ac clonebundles: fix typo 2015-12-15 07:17:15 +01:00
Augie Fackler
a84cc516e7 merge: restate calculateupdates in terms of a matcher
Once we get a matcher down into manifestmerge, we can make narrowhg
work more easily and potentially let manifest.match().diff() do less
work in manifestmerge.
2015-12-14 20:37:41 -05: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
timeless
4714e37c78 transplant: use Oxford comma 2015-11-30 19:28:26 +00:00
timeless
15faf26352 convert/svn: quiet check-config 2015-12-08 08:37:12 +00:00
FUJIWARA Katsunori
6cb3588722 censor: make censor acquire locks before processing
Before this patch, "hg censor" executes below:

  - without acquisition of wlock, examine whether the working
    directory refers the revision of the file to be censored or not

  - without acquisition of store lock (slock), replace existing
    filelog of file to be censored with censored one,

    Replacement consists of steps below, and it is assumed that the
    destination filelog at (1) isn't changed before renaming at (3).

    1. read existing filelog in
    2. write filelog entries (both censored and not) into temporary file
    3. rename from temporary file to existing filelog to be censored

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch makes "hg censor" acquire wlock and slock before
processing.
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
f9e9bdfb4f transplant: widen wlock scope of transplant for consitency while processing
Before this patch, "hg transplant" executes below before acquisition
of wlock.

  - cmdutil.checkunfinished()
  - repo.status() for dirty check
  - repo.dirstate.parents()

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch makes "hg transplant" acquire wlock before processing
instead of acquiring wlock in each of 'transplanter.apply()' and
'transplanter.recover()'.
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
3c4a554b71 shelve: remove redundant acquisition of wlock for sub commands of unshelve
Previous patch ensures that wlock is acquired before processing for
"hg unshelve". It makes acquisition of wlock in each functions below
redundant.

  - unshelveabort() for "unshelve --abort"
  - unshelvecontinue() for "unshelve --continue"
2015-12-09 08:28:53 +09:00
FUJIWARA Katsunori
d4f8b1a01a shelve: widen wlock scope of unshelve for consistency while processing
Before this patch, "hg unshelve" of shelve extension executes below
before acquisition of wlock:

  - cmdutil.checkunfinished()
  - examine existence of (specified) shelve file

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch widens wlock scope of "hg unshelve" of shelve extension for
consistency while processing.
2015-12-09 08:28:53 +09: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
Yuya Nishihara
a588ddbc95 rebase: remove extra "if" from check of collapsing named branches 2015-12-05 23:50:13 +09:00
Yuya Nishihara
d1c7989b16 rebase: drop redundant functions to keep branch and graft source explicitly
All entries in extra dict are propagated by default since 5293d4f88aef.
2015-12-05 23:48:22 +09:00
Yuya Nishihara
2298c7a029 color: drop useless override of ui.popbuffer()
Because labels are applied at write() time since ce03e7329682,
colorui.popbuffer() is useless and it doesn't update _bufferapplylabels
correctly. Removing it should fix the problem.
2015-12-05 23:41:11 +09:00
Laurent Charignon
c7dc44265f rebase: only clear rebase status after the rebase transaction has completed
In 6e6b18aab8b2, I made the mistake of moving the step "clearing the status
after a rebase" to inside the rebase transaction.
This was wrong, since we don't want to clear the status (and the rebase state)
if something went wrong during the transaction: if something goes wrong we
want to keep the rebase state to be able to abort.
It broke rebase with evolve + inhibit.
2015-12-03 08:31:20 -08: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
Mateusz Kwapich
644cc338bd histedit: add torule method to histedit action objects
To make histedit action objects responsible for understanding
the format of their action lines we are adding a torule method
which for a histedit action will return a string which can be
saved in histedit state or shown in text editor when editing the
plan.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
278e9a38b4 histedit: add verify() to histeditaction
This commits splits the parsing of the histedit rule from its semantic analysis.
It's necessary because sometimes we want to do first without doing the former (reading the
histedit state).
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
29346eb944 histedit: add addhisteditaction decorator
This decorator will is allowing us to move the registering the action
in actiontable closer to the action code. Also it is storing the
verb inside histedit action so the action is aware of the verb
needed to trigger it.
2015-12-02 12:19:01 -08:00
Mateusz Kwapich
122e188cce histedit: add actions property to histedit state
I want to refactor histedit to use action objects instead of (verb, rest)
pairs whenever possible. At the end of this series I want the rules to
be translated into action objects when reading state and translated back
when writing state. All histedit internals should use action objects instead
of state rules.

To migrate histedti internals sequentially I'm introducing the state.actions
property to translate rules on the fly so we can use both state.actions and
state.rules until refactoring is done.
2015-12-02 12:19:01 -08:00
FUJIWARA Katsunori
fc6772c5fc shelve: execute checkunfinished inside wlock scope
Before this patch, "hg shelve" of shelve extension executes
'cmdutil.checkunfinished()' before acquisition of wlock.

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

To avoid this issue, this patch executes 'cmdutil.checkunfinished()'
inside wlock scope of "hg shelve".

This also fixes issue4957, because now 'cmdutil.checkunfinished()'
isn't invoked at "hg shelve" with options below:

  --cleanup
  --delete
  --list
  --patch
  --stat
2015-12-02 03:12:08 +09:00
FUJIWARA Katsunori
157a86fc91 shelve: widen wlock scope of shelve for consistency while processing
Before this patch, "hg shelve" of shelve extension executes/refers
below before acquisition of wlock:

  - 'repo.dirstate.parents()' via 'repo[None].parents()'
  - 'repo._activebookmark'

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch widens wlock scope of "hg shelve" of shelve extension for
consistency while processing.
2015-12-02 03:12:08 +09:00
FUJIWARA Katsunori
f05ee67a9f gpg: make sign acquire wlock before processing
Before this patch, "hg sign" of gpg extension executes/evaluates below
without acquisition of wlock.

  - repo.dirstate.parents()
  - '.hgsigs' not in repo.dirstate

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

To avoid this issue, this patch makes "hg sign" of gpg extension
acquire wlock before processing.
2015-12-02 03:12:08 +09:00
Augie Fackler
c6a7c82c31 bookmarks: hoist getbkfile out of bmstore class
It's totally fine that this hook exists, but I don't see a need for it
to live inside the bmstore class.
2015-11-11 20:45:38 -05:00
timeless
787afdd271 histedit: mention histedit-last-edit.txt on abort
Users may spend a lot of effort writing histedit rules,
getting an abort without being told they can recover their work
is very frustrating.

Avoid that by telling them where to find their work.
2015-12-02 08:07:36 +00:00
timeless
40357ef4f4 histedit: add missing raise keyword to statement 2015-12-02 07:40:42 +00:00
timeless
139b830297 histedit: improve grammar for _histedit comment 2015-12-02 07:39:49 +00:00
Augie Fackler
840125d439 commands: inline definition of localrepo.parents() and drop the method (API)
localrepo.parents() has relatively few users, and most of those were
actually implicitly looking at the wctx, which is now made explicit
via repo[None].
2015-11-11 20:07:15 -05:00
Mykola Nikishov
0ee9a8cf79 histedit: edit with custom filename
For instance, Emacs allows to open file with special features enabled
(AKA mode) based on the path/name of the file [1]. For such cases, use
'hg-histedit-XXX.txt' as filename pattern.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Choosing-Modes.html
2015-11-21 17:40:26 +02:00
timeless
9b00c9388a patchbomb: rename email function
I see no reason for the function not to be email ...
2015-11-29 06:51:23 +00:00
timeless
dfb7d692a0 graphlog: rename glog function
I see no reason for the function not to be glog ...
2015-11-29 06:51:23 +00:00
Mike Edgar
8d4be9cc8f rebase: propagate extra dict from rebase source changeset
This corrects extra propagation for the rebase command and the shelve command.
2015-11-28 04:11:14 -05:00
Mathias De Maré
bbe157b7e0 histedit: add examples 2015-11-25 18:26:48 +01:00