Anton Shestakov <av6@dwimlabs.net> [Sat, 18 Nov 2017 13:00:47 +0800] rev 35087
check-code: grep's context flags don't need an extra space before number
A bit of useless trivia found while researching this: OpenBSD's grep's -C has a
default value (of 2) and disallows space before the argument (while -A and -B
allow).
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35086
dirstate: make map implementation overridable
Other implementations of dirstate will want to replace the class used for the
dirstate map. Allow this to happen by making the class an attribute of the
dirstate.
Differential Revision: https://phab.mercurial-scm.org/D1347
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35085
fsmonitor: only access inner dirstate map if it is available
As part of the dirstate refactor, fsmonitor was updated to directly access the
inner map of the dirstatemap object.
Dirstatemap reimplementations may not use a map like this, so only access it if
it is there.
Differential Revision: https://phab.mercurial-scm.org/D1346
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35084
dirstate: add explicit methods for querying directories (API)
The set-like object returned by dirstate.dirs may be difficult for other
implementations of the dirstate to provide, and is unnecessary as it is
only ever used for __contains__. Instead, provide an explicit method for
testing for a directory.
.. api::
dirstate no longer provides a `dirs()` method. To test for the existence of
a directory in the dirstate, use `dirstate.hasdir(dirname)`.
Differential Revision: https://phab.mercurial-scm.org/D1345
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35083
dirstate: remove _droppath method
This method now doesn't do very much interesting and can be removed. The
updated files set can be updated where _droppath was originally called.
Differential Revision: https://phab.mercurial-scm.org/D1344
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35082
dirstate: move dropping of folded filenames into the dirstate map
When dropping files from the dirstate, the corresponding entry in the
filefoldmap is also dropped. Move this into the dirstate map object. A future
implementation of the dirstate will maintain the filefoldmap differently.
Differential Revision: https://phab.mercurial-scm.org/D1343
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35081
dirstate: move management of the dirstate dirs into the dirstatemap
The dirstate dirs object is owned by the map, so move management of that object
there. A future implementation of the dirstate will manage the dirs object
differently.
Differential Revision: https://phab.mercurial-scm.org/D1342
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35080
dirstate: move management of nonnormal sets into dirstate map
The dirstate map owns the nonnormal sets, and so should be the class to update
them. A future implementation of the dirstate will manage these maps
differently.
The action of clearing ambiguous times is now entirely controlled by the
dirstate map, so it moves there too.
Differential Revision: https://phab.mercurial-scm.org/D1341
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35079
dirstate: add explicit methods for modifying dirstate
Instead of assigning dirstatetuple objects to entries in the dirstate, move
responsibility for creating tuples into the dirstatemap.
Differential Revision: https://phab.mercurial-scm.org/D1340
Mark Thomas <mbthomas@fb.com> [Wed, 15 Nov 2017 01:07:42 -0800] rev 35078
dirstate: document dirstatemap interface
Differential Revision: https://phab.mercurial-scm.org/D1380
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 19:12:56 -0800] rev 35077
bundlerepo: rename "bundlefilespos" variable and attribute
Strictly speaking, this variable tracks offsets within the
changegroup, not the bundle.
While we're here, mark a class attribute as private because
it is.
.. api::
Rename bundlerepo.bundlerepository.bundlefilespos to
_cgfilespos.
Differential Revision: https://phab.mercurial-scm.org/D1384
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 13 Nov 2017 19:12:17 -0800] rev 35076
bundlerepo: rename "bundle" arguments to "cgunpacker"
"bundle" was appropriate for the bundle1 days where a bundle
was a changegroup. In a bundle2 world, changegroup readers
are referred to as "changegroup unpackers."
Differential Revision: https://phab.mercurial-scm.org/D1383
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 11 Nov 2017 18:55:04 -0800] rev 35075
bundlerepo: use early return
I like avoiding patterns that lead to the pyramid of doom.
Differential Revision: https://phab.mercurial-scm.org/D1382
Boris Feld <boris.feld@octobus.net> [Sun, 05 Nov 2017 08:23:12 +0100] rev 35074
test-pattern: actually update tests using the patterns
We mass update the tests now. This will help the next soul touching the http
protocol.
Boris Feld <boris.feld@octobus.net> [Sun, 05 Nov 2017 08:23:53 +0100] rev 35073
test-pattern: substitute the HTTP log timestamp too
We add a pattern matching the infamous timestamp in http log. Now, we should be
able to have change appears in https log without having to re-glob the whole
thing over and over.
Boris Feld <boris.feld@octobus.net> [Mon, 13 Nov 2017 04:59:45 +0100] rev 35072
test-pattern: register the current the bundle2 capabilities string
The bundle capabilites are sent with every getbundle ssh connection. Every time
the protocol is updated, that string is altered. We get the part about bundle2
string replaced by $USUAL_BUNDLE2_CAPS$ so that we only have to change the
substitution whenever this happens.
Boris Feld <boris.feld@octobus.net> [Sun, 05 Nov 2017 06:43:40 +0100] rev 35071
test-pattern: register current the bundlecaps string
The bundle capabilites sent with every getbundle commands. Every time the
protocol is updated, that string is altered. We get that string replace by
$USUAL_BUNDLE_CAPS$ so that we only have to change the substitution whenever
this happens.
Boris Feld <boris.feld@octobus.net> [Sun, 05 Nov 2017 06:41:38 +0100] rev 35070
test-pattern: substitute common compression list
The compression list as to be matched with a glob because zstd might not be part
of the option. By using a substitution for these, we won't have to re-glob them
over and over.
Boris Feld <boris.feld@octobus.net> [Sun, 05 Nov 2017 06:34:27 +0100] rev 35069
run-tests: allow to register any arbitrary pattern for replacement
We add a 'common-pattern.py' file that allow to define extra pattern. This seems
a cleaner approach than editing the 'run-test.py' file over and over. In
addition allowing arbitrary pattern registration will also help extension.
The format used is a python file is picked out of convenience defining a list of
tuple in 'substitutions' variable. This is picked out of convenience since it is
dead simple to implement.
The end goal is to register more pattern for Mercurial test. There are multiple
common patterns that change over time. That impact is annoying. Using pattern
emplacement for them would be handy.
The next patches will define all the needed patterns and the last patch will
mass-update the tests outputs as it was easier to do in a single pass.
Jun Wu <quark@fb.com> [Mon, 13 Nov 2017 18:22:25 -0800] rev 35068
crecord: fix revert -ir '.^' crash caused by
3649c3f2cd
3649c3f2cd (revert: do not reverse hunks in interactive when REV is not
parent (
issue5096)) changed the record "operation" for the text version but
missed the curses version. Without this patch, running
`hg revert -ir '.^' --config ui.interface=curses` would crash with:
ProgrammingError: unexpected operation: apply
Differential Revision: https://phab.mercurial-scm.org/D1381
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Nov 2017 17:11:14 -0800] rev 35067
tweakdefaults: turn on ui.statuscopies
Seems obviously useful and probably off by default for historical
reasons.
Differential Revision: https://phab.mercurial-scm.org/D1444
Kyle Lippincott <spectral@google.com> [Wed, 15 Nov 2017 17:54:27 -0800] rev 35066
run-tests: fix TESTDIR if testdescs are absolute paths
Commit
a18eef03d879 made TESTDIR be the location of the arguments that were
passed to run-tests.py instead of just PWD. It assumed that these tests were
specified using relative paths, so if pwd was /tmp/foo, and the first argument
was /tmp/baz, it would set TESTDIR to /tmp/foo//tmp/baz.
Differential Revision: https://phab.mercurial-scm.org/D1433
Anton Shestakov <av6@dwimlabs.net> [Thu, 16 Nov 2017 22:21:03 +0800] rev 35065
hgweb: show commit phase if it's not public
In spartan theme phase is shown on its own table row, because there's no single
line of "tags". Everywhere else phase is prepended to the list of "tags" of a
changeset. Its element has a purple-ish color in gitweb and monoblue, and a
dotted line under it and no color in paper and coal (as these themes are frugal
with colors).
This patch intentionally doesn't touch graph, because it needs a rewrite. I'll
get to it pretty soon and in the process will add phase and everything that's
still coming (e.g. obsolescence and instabilities).
.. feature::
hgweb now displays phases of non-public changesets
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.