Commit Graph

34927 Commits

Author SHA1 Message Date
Martin von Zweigbergk
13e75f668f patch: accept prefix argument to changedfiles() helper
I'd like to call the function from an extension, passing both "strip"
and "prefix", but it currently only accepts "strip". The only in-tree
caller seems to be mq.py, which doesn't even pass "strip".

Differential Revision: https://phab.mercurial-scm.org/D1413
2017-11-14 10:26:36 -08:00
Anton Shestakov
e6c6d397c1 hgweb: move changeset "tags" to a template in map file (gitweb and monoblue)
Less duplication and it's also easier to add extra "tags" everywhere at once.

These aren't tags as defined `hg help glossary` (hence the quotes), they are
simply called that. They include branch name (in different styles if changeset
is a head of that branch or not), (actual) tags and bookmarks. Good candidates
to add to this list would be changeset phase and obsoletion status.
2017-11-15 19:36:16 +08:00
Anton Shestakov
0bd28b8467 hgweb: split long lines in gitweb and monoblue (changeset summary and tags) 2017-11-15 16:06:00 +08:00
Paul Morelle
0ec1e298bd debugdeltachain: output information about sparse read if enabled 2017-10-26 09:27:09 +02:00
Denis Laxalde
be2630530f rebase: exclude descendants of obsoletes w/o a successor in dest (issue5300)
.. feature::

   Let 'hg rebase' avoid content-divergence by skipping obsolete
   changesets (and their descendants) when they are present in the rebase
   set along with one of their successors but none of their successors is
   in destination.

In the following example, when trying to rebase 3:: onto 2, the rebase
will abort with "this rebase will cause divergence from: 4":

    o  7 f
    |
    | o  6 e
    | |
    | o  5 d'
    | |
    x |  4 d (rewritten as 5)
    |/
    o  3 c
    |
    | o  2 x
    | |
    o |  1 b
    |/
    o  0 a

By excluding obsolete changesets without a successor in destination (4
in the example above) and their descendants, we make rebase work in this
case, thus giving:

    o  11 e
    |
    o  10 d'
    |
    o  9 c
    |
    o  8 b
    |
    | o  7 f
    | |
    | | x  6 e (rewritten using rebase as 11)
    | | |
    | | x  5 d' (rewritten using rebase as 10)
    | | |
    | x |  4 d
    | |/
    | x  3 c (rewritten using rebase as 9)
    | |
    o |  2 x
    | |
    | x  1 b (rewritten using rebase as 8)
    |/
    o  0 a

where branch 4:: is left behind while branch 5:: is rebased as expected.

The rationale is that users may not be interested in rebasing orphan
changesets when specifying a rebase set that include them but would
still want "stable" ones to be rebased. Currently, the user is suggested
to allow divergence (but probably does not want it) or they must specify
a rebase set excluding problematic changesets (which might be a bit
cumbersome). The approach proposed here corresponds to "Option 2" in
https://www.mercurial-scm.org/wiki/CEDRebase.


We extend _computeobsoletenotrebased() so that it also return a set of
obsolete changesets in rebase set without a successor in destination but
with at least one successor in rebase set. This
'obsoletewithoutsuccessorindestination' is then stored as an attribute
of rebaseruntime and used in _performrebasesubset() to:

* filter out descendants of these changesets from the revisions to
  rebase;
* issue a message about these revisions being skipped.

This only occurs if 'evolution.allowdivergence' option is off and
'rebaseskipobsolete' is on.
2017-11-14 22:46:10 +01:00
Denis Laxalde
e72a769d6d tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
It helps understanding tests.
2017-11-11 19:25:32 +01:00
Denis Laxalde
7ee2d47fd5 tests: conditionally display obsfate in test-rebase-obsolete log output
This helps understanding and debugging.
2017-11-06 22:08:02 +01:00
Denis Laxalde
9d3236b8fd tests: clarify a comment in test-rebase-obsolete.t 2017-11-11 19:23:31 +01:00
Gregory Szorc
a4f1d34829 bundlerepo: rename _bundle to _cgunpacker
_bundle is really a changegroup unpacker instance. Rename the
variable accordingly.

Differential Revision: https://phab.mercurial-scm.org/D1379
2017-11-11 18:41:14 -08:00
Gregory Szorc
f8da298c93 bundlerepo: assign bundle attributes in bundle type blocks
It is a bit wonky to assign the same object to multiple
attributes and then possibly overwrite them later.

Refactor the code to use a local variable and defer attribute
assignment until the final values are ready.

This required passing the bundle instance to _handlebundle2part().
The only use of this method I could find is Facebook's
treemanifest extension. Since it is a private method, I don't
think it warrants an API callout.

Differential Revision: https://phab.mercurial-scm.org/D1378
2017-11-11 18:34:50 -08:00
Gregory Szorc
d446e5fd4c bundlerepo: make bundle and bundlefile attributes private
These attributes are implementation details and shouldn't be
exposed outside the class.

.. api::

   bundlerepo.bundlerepository.bundle and
   bundlerepo.bundlerepository.bundlefile are now prefixed with an
   underscore.

Differential Revision: https://phab.mercurial-scm.org/D1377
2017-11-11 18:22:36 -08:00
Gregory Szorc
4303257e0a bundlerepo: don't assume there are only two bundle classes
exchange.readbundle() can return a type that represents a stream
clone bundle. Explicitly handle the bundle1 type and raise a
reasonable error message for unhandled bundle types.

Differential Revision: https://phab.mercurial-scm.org/D1376
2017-11-11 18:14:41 -08:00
Gregory Szorc
96510ffc31 bundlerepo: add docstring for bundlerepository class
Differential Revision: https://phab.mercurial-scm.org/D1375
2017-11-11 18:09:16 -08:00
Gregory Szorc
dfe2ba26ec bundlerepo: rename arguments to bundlerepository.__init__
To reflect what they actually are.

Differential Revision: https://phab.mercurial-scm.org/D1374
2017-11-11 18:05:02 -08:00
Gregory Szorc
ba1e1e4a72 bundlerepo: use suffix variable
It looks like the refactor in 0883a2ece555 attempted to establish
this method argument but failed to use it. My editor caught it.

Differential Revision: https://phab.mercurial-scm.org/D1373
2017-11-11 17:07:33 -08:00
Gregory Szorc
f9ea80f7a0 bundlerepo: make methods agree with base class
My editor was complaining about mismatches between method
signatures.

For methods that are implemented, we change arguments to match
the base. For those that aren't, we use variable arguments
because it shouldn't matter.

Differential Revision: https://phab.mercurial-scm.org/D1372
2017-11-11 17:02:31 -08:00
Gregory Szorc
db823f8dff bundle2: use os.SEEK_* constants
Constants make code easier to read than magic numbers.

I also threw in an explicit argument in a caller to further
increase code comprehension.

Differential Revision: https://phab.mercurial-scm.org/D1370
2017-11-11 16:48:40 -08:00
Rodrigo Damazio Bovendorp
80a38c9b47 help: adding a topic on flags
This is a short topic to explain how command-line flags can be specified.

Some users have been confused by hg offerring different flag syntax than some
other libraries, so it'd be nice to point them to this rather than explaining
it every time.

Differential Revision: https://phab.mercurial-scm.org/D1270
2017-10-30 20:35:30 -07:00
Pulkit Goyal
a4ac6fb7f7 py3: handle keyword arguments correctly in hgext/patchbomb.py
The keys of keyword arguments must be str on Python 3 which is unicode. This
patch make sure we pass keyword arguments with keys are str everywhere in this
file and access the keys depending on whether they are bytes or str.

This patch uses pycompat.{byteskwargs|strkwargs} and somewhere it also added r''
to prevent transformer from adding a b'' over there.

Differential Revision: https://phab.mercurial-scm.org/D974
2017-10-06 05:47:56 +05:30
Anton Shestakov
034b4b25c1 tests: use jshint when available to check .js files 2017-11-11 15:07:21 +08:00
Anton Shestakov
1f9fda40f1 hgweb: fix jshint issues in mercurial.js
Everything is pretty self-explanatory except the last hunk, where jshint
complains: "Misleading line break before '||'; readers may interpret this as an
expression boundary."

There is a tweakable called "laxbreak" that allows line breaks before
operators, but I think it's fine to simply join this one line and avoid extra
config for now (we can cook up and add a sensible .jshintrc later).
2017-11-11 14:14:38 +08:00
Boris Feld
196fe39bef exchange: drop unused '_getbookmarks' function
The function was introduced in 9234f8384fd7 in mid-November 2016 but is never
used anywhere in core.
2017-10-17 15:55:40 +02:00
Boris Feld
39740a8ab7 bookmark: use bundle2 debug output in one push tests
Having more details about the push process will help to track changes made to
the actual exchange.
2017-10-15 15:21:47 +02:00
Boris Feld
a22d32adae pull: store binary node in pullop.remotebookmarks
The internal representation of bookmark value is binary. The fact we stored
'hex' was an implementation detail from using pushkey.

We move the values in 'pullop.remotebookmarks' to binary before adding a way to
exchange bookmarks not based on pushkey.
2017-10-17 11:01:45 +02:00
David Demelier
15d6fd309d config: rename allow_push to allow-push
As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.

[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
2017-10-19 11:46:41 +02:00
David Demelier
d3338e9bad config: rename allowpull to allow-pull
As part of ConfigConsolidationPlan [1], rename the option according to
the new UI guidelines [2] and add an alias for backward compatibility.

[1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan
[2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
2017-10-19 11:43:19 +02:00
Anton Shestakov
2713fb3796 hgweb: add missing semicolons to followlines.js
Minor stylistic issues caught by jshint.
2017-11-10 19:14:06 +08:00
Anton Shestakov
1132b26766 gitweb: apply styles from annotate tooltip to followlines popup
These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to gitweb or any other hgweb theme.
2017-11-10 18:50:44 +08:00
Anton Shestakov
34b93f7b60 paper: apply styles from annotate tooltip to followlines popup
These new colors and styles are already used in the tooltip that gets shown
when user hovers over line numbers on annotate page. The old styles, replaced
in this patch, look completely unrelated to paper or any other hgweb theme.
2017-11-10 18:45:43 +08:00
Martin von Zweigbergk
b2813c6218 pull: clarify that -u only updates linearly
Differential Revision: https://phab.mercurial-scm.org/D1355
2017-11-10 09:44:49 -08:00
Mark Thomas
1271cb536c dirstate: don't remove normallookup files from nonnormalset
The dirstate typically tries to keep the nonnormalset and otherparentset
up-to-date when making changes to the dirstate.  In the case of files marked
normallookup, however, it erroneously removes the file from the nonnormalset,
after _addpath had just added it.

This doesn't seem to matter at the moment, as nothing relies on the
nonnormalset being correct at this point, however a future re-implementations
of the dirstate map will require this to be kept up-to-date correctly.

Differential Revision: https://phab.mercurial-scm.org/D1339
2017-11-08 09:27:14 -08:00
Mark Thomas
a4a1780063 dirstate: clear map cached properties when clearing the map
dirstatemap.clear should remove all record of the files in the map.  This
includes removing caches of values derived from these.

Differential Revision: https://phab.mercurial-scm.org/D1338
2017-11-08 09:23:53 -08:00
Mark Thomas
83d7887053 util: add util.clearcachedproperty
This utility function allows clearing of the cached value set up
@propertycache, if there is one.

Differential Revision: https://phab.mercurial-scm.org/D1337
2017-11-08 09:18:18 -08:00
Augie Fackler
1df23f1a7a merge with stable 2017-11-10 17:12:04 -05:00
Kyle Lippincott
61883896f6 changegroup: use any node, not min(), in treemanifest's generatemanifests
This is fixing quadratic behavior, which is probably not noticeable in the
common case, but if a very large directory gets added here, it can get pretty
bad. This was noticed because we had some pushes that spent >25s in changegroup
generation calling min() here, according to profiling.

The original reasoning for min() being used in 1d71430e1d28 was that, at that
point in the series, we were adding almost everything to tmfnodes during the
first iteration through the loop , so we needed to avoid sending child
directories before parents. Later changes made it so that the child directories
were added only when we visited the parent directory (not all of them on the
first iteration), so this is no longer necessary - there won't be any child
directories in tmfnodes before the parents have been sent.

This does mean that the manifests are now exchanged unordered, whereas
previously we would essentially do [a, b, b/c, b/c/d, e], we now can send a, b,
and e in any order; b/c must still follow b, and b/c/d must still follow b/c.

Differential Revision: https://phab.mercurial-scm.org/D1351
2017-11-08 18:24:43 -08:00
Durham Goode
76228a6bf0 bundle: allow bundlerepo to support alternative manifest implementations
With our treemanifest logic, the manifests are no longer transported as part of
the changegroup and are no longer stored in a revlog. This means the
self.manifestlog line in bundlerepo.filestart no longer calls
_constructmanifest, and therefore does not consume the manifest portion of the
changegroup, which means filestart is not populated and we result in an infinite
loop.

The fix is to make filestart aware that self.manifestlog might not consume the
changegroup part, and consume it manually if necessary.

There's currently no way to test this in core, but our treemanifest extension
has tests to cover this.

Differential Revision: https://phab.mercurial-scm.org/D1329
2017-11-07 10:16:53 -08:00
Boris Feld
057760a2d2 obsfate: makes successorsetverb takes the markers as argument
Right now, successorsetverb only needs successors to compute the verb. But we
will want use additional information (effect-flags and operation) in the near
future to compute a better verb.

Add the markers parameter now so extensions (like Evolve) could wrap the
function and start experimenting around better obsfate verbs.

As successorsetverb now takes both successorset and markers parameters, rename
it to obsfateverb, successorsetandmarkersverb was too long.

Differential Revision: https://phab.mercurial-scm.org/D1191
2017-10-19 12:35:47 +02:00
Ryan McElroy
b4e9abb79e cmdutil: create dirs for templated cat file output
Previously, the caller was responsible for creating the directory structure of
files written out using a path template. This is onerous, especially if the
exact filenames are not known upfront, but are being accessed via a matcher.

This patch changes things so that hg will attempt to create the appropriate
directories before writing the output file.

Differential Revision: https://phab.mercurial-scm.org/D1332
2017-11-07 13:48:33 -08:00
Ryan McElroy
8a42972c74 cat: test output path behvaior when target path does not exist
In the next patch, we will change the behavior of the cat command to create
output file parent directories before attempting to write the output file.
This patch documents the current unfortunate behavior.

Differential Revision: https://phab.mercurial-scm.org/D1331
2017-11-07 13:46:15 -08:00
Pulkit Goyal
6f6b384e3b py3: handle keyword arguments in hgext/shelve.py
Differential Revision: https://phab.mercurial-scm.org/D1324
2017-10-23 00:06:49 +05:30
Pulkit Goyal
5fe15c38d8 py3: handle keyword arguments in hgext/uncommit.py
Differential Revision: https://phab.mercurial-scm.org/D1323
2017-10-23 00:06:23 +05:30
Pulkit Goyal
e280703a0a py3: handle keyword arguments in hgext/releasenotes.py
Differential Revision: https://phab.mercurial-scm.org/D1322
2017-10-23 00:05:04 +05:30
Pulkit Goyal
08c0fc04ca py3: handle keyword arguments in hgext/rebase.py
Differential Revision: https://phab.mercurial-scm.org/D1321
2017-10-23 00:04:47 +05:30
Pulkit Goyal
f0a43ec691 py3: handle keyword arguments in hgext/keyword.py
Differential Revision: https://phab.mercurial-scm.org/D1320
2017-10-23 00:04:30 +05:30
Pulkit Goyal
31603eadc3 py3: handle keyword arguments in hgext/journal.py
Differential Revision: https://phab.mercurial-scm.org/D1319
2017-10-23 00:04:12 +05:30
Pulkit Goyal
efe36fbe83 py3: handle keyword arguments in hgext/histedit.py
Differential Revision: https://phab.mercurial-scm.org/D1318
2017-10-23 00:03:54 +05:30
Pulkit Goyal
fd754ab7dc py3: handle keyword arguments in hgext/hgk.py
Differential Revision: https://phab.mercurial-scm.org/D1317
2017-10-23 00:03:27 +05:30
Pulkit Goyal
845caba95e py3: handle keyword arguments in hgext/graphlog.py
Differential Revision: https://phab.mercurial-scm.org/D1316
2017-10-23 00:03:08 +05:30
Augie Fackler
7ed032e935 merge with stable 2017-11-07 13:18:49 -05:00
Yuya Nishihara
dfea246882 templatekw: add verbosity keyword to select template by -q/-v/--debug flag
This can be used in conjunction with the ifeq() function.
2017-10-21 17:46:41 +09:00