Anton Shestakov <av6@dwimlabs.net> [Wed, 15 Nov 2017 23:55:09 +0800] rev 35064
hgweb: move changeset "tags" to a template in map file (paper and coal)
This patch puts all these changeset "tags" into one template shared everywhere
in paper and coal themes. But it should be noted that some of the templates had
different sets of tags, in some cases it was intended, in others - most likely
not.
First, what's up with all these different ways to get changeset's branch. There
are actually 3 ways to do it in hgweb, they can all be seen in this patch;
"branches", "inbranch" and "branch". They are all lists that consist of 1 or 0
items:
- "branches" has ctx.branch() if current changeset is the tip of that branch
- "inbranch" has ctx.branch() if current changeset is _not_ the tip of that
branch and the branch is not "default"
- "branch" aka "changesetbranch" has ctx.branch() if the branch is not
"default"
The majority of cases (7 vs 2 + /graph) in paper theme used only option 3,
which meant that "default" was never displayed. But other parts of the theme
disagreed with this and used option 1 and option 2 together. For example, the
default view (log) displays "default" on the branch tip (can be seen right
about now on m-s.o/repo/hg), but it disappears when you click on the commit.
Also, using option 3 alone meant that there was no way to tell if a changeset
is the tip of its branch or not (it was always assumed that it's not, see how
some css classes change from "branchname" to the correct "branchhead" in tests)
-- so the two different css styles that exist in paper just for this were
underused.
I think this patch improves the situation, even though it changes the old (even
if inconsistent) behavior. The new behavior matches that of gitweb and
monoblue.
Boris Feld <boris.feld@octobus.net> [Fri, 03 Nov 2017 21:01:20 +0100] rev 35063
logtoprocess: clean-up old comment
The comment was likely to be for runshellcommand code.
Differential Revision: https://phab.mercurial-scm.org/D1425
Martin von Zweigbergk <martinvonz@google.com> [Tue, 14 Nov 2017 10:26:36 -0800] rev 35062
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
Anton Shestakov <av6@dwimlabs.net> [Wed, 15 Nov 2017 19:36:16 +0800] rev 35061
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.
Anton Shestakov <av6@dwimlabs.net> [Wed, 15 Nov 2017 16:06:00 +0800] rev 35060
hgweb: split long lines in gitweb and monoblue (changeset summary and tags)
Paul Morelle <paul.morelle@octobus.net> [Thu, 26 Oct 2017 09:27:09 +0200] rev 35059
debugdeltachain: output information about sparse read if enabled
Denis Laxalde <denis@laxalde.org> [Tue, 14 Nov 2017 22:46:10 +0100] rev 35058
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.
Denis Laxalde <denis@laxalde.org> [Sat, 11 Nov 2017 19:25:32 +0100] rev 35057
tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
It helps understanding tests.
Denis Laxalde <denis@laxalde.org> [Mon, 06 Nov 2017 22:08:02 +0100] rev 35056
tests: conditionally display obsfate in test-rebase-obsolete log output
This helps understanding and debugging.
Denis Laxalde <denis@laxalde.org> [Sat, 11 Nov 2017 19:23:31 +0100] rev 35055
tests: clarify a comment in test-rebase-obsolete.t
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:41:14 -0800] rev 35054
bundlerepo: rename _bundle to _cgunpacker
_bundle is really a changegroup unpacker instance. Rename the
variable accordingly.
Differential Revision: https://phab.mercurial-scm.org/D1379
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:34:50 -0800] rev 35053
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:22:36 -0800] rev 35052
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:14:41 -0800] rev 35051
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:09:16 -0800] rev 35050
bundlerepo: add docstring for bundlerepository class
Differential Revision: https://phab.mercurial-scm.org/D1375
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:05:02 -0800] rev 35049
bundlerepo: rename arguments to bundlerepository.__init__
To reflect what they actually are.
Differential Revision: https://phab.mercurial-scm.org/D1374
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 17:07:33 -0800] rev 35048
bundlerepo: use suffix variable
It looks like the refactor in
702a26fec3e2 attempted to establish
this method argument but failed to use it. My editor caught it.
Differential Revision: https://phab.mercurial-scm.org/D1373
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 17:02:31 -0800] rev 35047
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
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 16:48:40 -0800] rev 35046
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
Rodrigo Damazio Bovendorp <rdamazio@google.com> [Mon, 30 Oct 2017 20:35:30 -0700] rev 35045
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
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 06 Oct 2017 05:47:56 +0530] rev 35044
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
Anton Shestakov <av6@dwimlabs.net> [Sat, 11 Nov 2017 15:07:21 +0800] rev 35043
tests: use jshint when available to check .js files
Anton Shestakov <av6@dwimlabs.net> [Sat, 11 Nov 2017 14:14:38 +0800] rev 35042
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).
Boris Feld <boris.feld@octobus.net> [Tue, 17 Oct 2017 15:55:40 +0200] rev 35041
exchange: drop unused '_getbookmarks' function
The function was introduced in
8491845a75b2 in mid-November 2016 but is never
used anywhere in core.
Boris Feld <boris.feld@octobus.net> [Sun, 15 Oct 2017 15:21:47 +0200] rev 35040
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.
Boris Feld <boris.feld@octobus.net> [Tue, 17 Oct 2017 11:01:45 +0200] rev 35039
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.
David Demelier <markand@malikania.fr> [Thu, 19 Oct 2017 11:46:41 +0200] rev 35038
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
David Demelier <markand@malikania.fr> [Thu, 19 Oct 2017 11:43:19 +0200] rev 35037
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
Matt Harbison <matt_harbison@yahoo.com> [Tue, 28 Nov 2017 23:20:08 -0500] rev 35036
convert: avoid wrong lfconvert defaults by moving configitems to core
The `hg lfconvert --to-normal` command uses the convert extension internally to
work its magic, but that produced devel-warn messages if the convert extension
wasn't loaded by the user. The test in
fcd2f9b06629 (modified here) wasn't
showing the warnings because the convert extension was loaded via $HGRCPATH.
Most of the config options default to None/False, but 'hg.usebranchnames' and
'hg.tagsbranch' are supposed to default to True and 'default' respectively.
The first iteration of this was to ui.setconfig() inside lfconvert, to force the
convert extension to load. But there really is no precedent for doing this, and
check-config complained that 'extensions.convert' isn't documented. Yuya
suggested this alternative.
This partially backs out
0d5a1175d0f9.
Boris Feld <boris.feld@octobus.net> [Fri, 24 Nov 2017 21:51:41 -0500] rev 35035
tr-summary: keep a weakref to the unfiltered repository
Repoview can have a different life cycle, causing issue in some corner
cases. The particular instance that revealed this comes from localpeer. The
localpeer hold a reference to the unfiltered repository, but calling 'local()'
will create an on-demand 'visible' repoview. That repoview can be garbaged
collected any time. Here is a simplified step by step reproduction::
1) tr = peer.local().transaction('foo')
2) tr.close()
After (1), the repoview object is garbage collected, so weakref used in (2)
point to nothing.
Thanks to Sean Farley for helping raising and debugging this issue.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 12:40:13 +0900] rev 35034
dispatch: verify result of early command parsing
Before, early options were stripped from args, and because of this, some
kind of parsing errors weren't reported. For example,
$ hg ci -m -Ra file
would execute "hg ci -m file" in repository "a".
This patch fixes the issue by parsing early options again by real getopt-based
parser, and verifying the results. If the early parsing appears wrong, hg just
aborts. The current error message seems not nice, and should be improved, maybe
in V2 or follow-up.
Note that this isn't a security feature because we can still do anything by
using shell aliases.
Yuya Nishihara <yuya@tcha.org> [Sat, 11 Nov 2017 17:55:15 +0900] rev 35033
dispatch: convert non-list option parsed by _earlygetopt() to string
So we can easily compare it with the corresponding getopt() result.
There's a minor behavior change. Before, "hg --cwd ''" failed with ENOENT.
But with this patch, an empty cwd is silently ignored. "hg -R ''" has always
worked as such, so -R has no BC.