Commit Graph

5268 Commits

Author SHA1 Message Date
Laurent Charignon
0faf1a71c4 rebase: prevent creating divergence
Before this patch rebase would create divergence when you were rebasing obsolete
changesets on a destination not containing one of its successors.
This patch introduces rebase.allowdivergence to explicitly allow
divergence creation with rebase.
2016-01-12 13:43:41 -08:00
Laurent Charignon
83309d717a rebase: create a new variable to make the next patch more legible 2016-01-06 12:55:56 -08:00
Laurent Charignon
9d840a1d82 rebase: minor refactoring of _computeobsoletenotrebased
This patch is a refactoring of the code skipping obsolete changesets already
present in destination. It makes the following patches more legible.
Instead of passing all the revs to be rebased to _computeobsoletenotrebased,
we only pass the obsolete revisions of the rebaseset.
2016-01-06 12:55:56 -08:00
Gregory Szorc
5732d02b64 exchange: make clone bundles non-experimental and enabled by default
The clone bundles feature was introduced in Mercurial 3.6 behind an
experimental and disabled by default flag. The feature has been enabled
on hg.mozilla.org for a few months and has served many terabytes of
clones. Users have been encouraged to use the feature and reception
has been very positive (mainly due to faster clones as a result of
connecting to a CDN). I have heard no feedback about changing the
feature other than inquiries about when it will be enabled by default.
So, I think the feature is ready to be enabled by default.

This patch renames experimental.clonebundles to ui.clonebundles,
documents the option, and enables it by default. References to the
experimental state of clone bundles have been removed. The remaining
config option docs in clonebundles.py have been removed because they
are redudant with `hg help config`.

There are some oddities with behavior of clone bundles. Because clones
with clone bundles are effectively 2 `hg pull` operations, there may be
2 transactions. This could result in hooks running twice. If the
subsequent pull is aborted, it could result in partial rollback and an
incomplete clone. This behavior is a bit wonky and should probably
be documented. If this patch is accepted, I'll send a follow-up to
document it. I don't think this behavior should prevent the feature
being enabled by default. Reworking the clone mechanism to support
interrupted or multi-part clones feels like a major new feature and
something that when implemented can change the hook and rollback
semantics of clone bundles. Besides, partial clone is better than
full rollback and hooks running on initial clone are likely rare, so I
think the impact is minimal.
2016-01-08 10:58:04 -08:00
Gregory Szorc
0436f8dd18 exchange: make clonebundleprefers non-experimental
In preparation for making the feature enabled by default.
2016-01-08 10:57:01 -08:00
Gregory Szorc
2c9adcd9c5 clonebundles: remove advertisement of feature
I screwed up.

When clone bundles is enabled on the server and a compatible client
without the feature enabled clones, the server sends down an
advertisement saying to enable the feature. The server creates the
message which is printed verbatim on the client as an "output" part.
There are 2 problems:

1) The message doesn't respect the client's localization
2) The message contains a reference to the "experimental.clonebundles"
   option.

Since clone bundles is about to be marked as non-experimental and the
goal of the advertisement was to encourage clients to test the
experimental feature, let's just remove the broken advertisement since
it no longer serves a purpose.
2016-01-08 10:53:07 -08:00
Martin von Zweigbergk
ee22e78a3b convert: use manifest.diff() instead of ctx.status()
mercurial_source.getchanges() seems to care about files whose nodeid
has changed even if their contents has not (i.e. it has been
reverted/backed out). The method uses ctx1.status(ctx2) to find
differencing files. However, that method is currently broken and
reports reverted changes as modified. In order to fix that method, we
first need to rewrite getchanges() using manifest.diff(), which does
report reverted files as modified (because it's about differences in
the manifest, so about nodeids).
2016-01-09 22:58:10 -08:00
Martin von Zweigbergk
933fd7efd0 convert: replace cache of (m,a,r) by (ma,r)
The next commit will rewrite the way we find changes between two
manifests. By making the cache not care about the difference between
added and modified files, we don't require the rewritten code to care
about that difference either. Also extract the call to ctx.status() to
simplify the next commit.
2016-01-10 21:07:34 -08:00
Martin von Zweigbergk
16f9affccf convert: use _ prefix for private methods in hg sink
This makes it clearer which methods are part of the interface defined
by the superclass.
2016-01-09 21:42:48 -08:00
timeless
699a790124 children: update help with replacement 2016-01-06 17:18:18 +00:00
timeless
78198d84e4 graphlog: update help with replacement 2016-01-06 17:17:49 +00: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
Bryan O'Sullivan
9fc5431d91 patchbomb: treat empty address list as no addresses
Previously it wasn't possible to use configuration to avoid
being prompted for e.g. a CC list when using patchbomb to send
emails.

We now make it possible to supply an empty value.
2016-01-07 20:02:47 -08:00
timeless
ce2180cfc6 shelve: hook afterresolvedstates 2016-01-05 22:23:27 +00:00
Yuya Nishihara
699ec74ad9 extdiff: use @command decorator to set up diff commands
It can set "inferrepo" attribute appropriately.
2016-01-01 22:35:34 +09:00
Yuya Nishihara
daf4a450f1 extdiff: factor out list of common options 2016-01-04 22:13:46 +09:00
timeless
35854385ce transplant: specify the right file and path for unfinishedstates 2016-01-06 04:59:46 +00:00
timeless
aa6a7a6e4d transplant: only use checkunfinished if not continue 2016-01-06 04:59:21 +00:00
timeless
57af46935b transplant: correct language to use working directory 2016-01-05 22:46:04 +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
Siddharth Agarwal
2584b69484 merge: add a new 'backup' argument to get actions
We're going to use this in an upcoming patch to back untracked files up when
they're replaced by tracked ones.
2016-01-02 03:02:57 -08:00
Siddharth Agarwal
0efe3372e4 origpath: move from cmdutil to scmutil
This is a lower-level function so it doesn't need to be in cmdutil, and putting
it here avoids a bunch of potential import cycle issues.
2016-01-02 03:02:57 -08:00
timeless
ebb1d48658 cleanup: remove superfluous space after space after equals (python) 2015-12-31 08:16:59 +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
b2b9fb00e6 rebase: hook afterresolvedstates 2015-12-24 20:41:40 +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
FUJIWARA Katsunori
4d06739a86 revset: use delayregistrar to register predicate in extension easily
Previous patch introduced 'revset.predicate' decorator to register
revset predicate function easily.

But it shouldn't be used in extension directly, because it registers
specified function immediately. Registration itself can't be restored,
even if extension loading fails after that.

Therefore, registration should be delayed until 'uisetup()' or so.

This patch uses 'extpredicate' decorator derived from 'delayregistrar'
to register predicate in extension easily.

This patch also tests whether 'registrar.delayregistrar' avoids
function registration if 'setup()' isn't invoked on it, because
'extpredicate' is the first user of it.
2015-12-29 23:58:30 +09:00
Laurent Charignon
901d6a2088 rebase: better error message when rebased changes are all in destination
Before this patch, when rebasing a set of obsolete revisions that were plain
pruned or already present in the destination, we were displaying:

abort: no matching revisions

This was not very helpful to understand what was going on, instead we replace
the error message by:

abort: all requested changesets have equivalents or were marked as obsolete
(to force the rebase, set the config experimental.rebaseskipobsolete to False)
2015-12-29 15:32:12 -08: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
Matt Mackall
798e034a3c merge with stable 2015-12-28 10:11:48 -06: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
Bryan O'Sullivan
cf9489897c eol: make output stable
This eliminates a divergence in behaviour between PyPy and Python.
2015-12-27 23:55:54 +09:00
FUJIWARA Katsunori
4d3a0ec7d1 mq: use fallback patch name if no alpha-numeric in summary line (issue5025)
Before this patch, "hg qimport -r REV" fails, if the summary line of
description of REV doesn't contain any alpha-numeric bytes.

In this case, all bytes in the summary line 'title' are dropped from
'namebase' by the code path below.

     namebase = re.sub('[\s\W_]+', '_', title.lower()).strip('_')

'makepatchname()' immediately returns this empty string as valid patch
name, because patch name conflicting against empty string never
exists.

Then, "hg qimport -r REV" is aborted at creation of patch file with
empty filename.

This situation isn't so rare. For example, ordinary texts in Japanese
often consist of non alpha-numeric bytes in UTF-8.

This patch makes 'makepatchname()' use fallback patch name if the
summary line of imported revision doesn't contain any alpha-numeric
bytes.
2015-12-23 22:28:52 +09:00
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