Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 16:58:59 -0700] rev 33999
metadataonlyctx: don't crash when reusing the manifest with deletions
This was originally fixed by Mateusz Kwapich for the `metaedit` command in
fb-hgext with a test for the `metaedit` command. It didn't get upstreamed
because `metaedit` was not in core.
This patch fixes the crash and adds a test about `metadataonlyctx` to
avoid future regressions.
Differential Revision: https://phab.mercurial-scm.org/D550
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 16:49:41 -0700] rev 33998
context: make parents and text optional in metadataonlyctx
The metadataonlyctx is to copy an existing context with some minor metadata
changes. If the caller only wants to change "extra", or "user", ideally it
does not have to read and pass "parents" and "text" information.
This patch makes "parents" and "text" optionally to convenient callers.
Differential Revision: https://phab.mercurial-scm.org/D548
Boris Feld <boris.feld@octobus.net> [Thu, 17 Aug 2017 18:09:32 +0200] rev 33997
test: add more obsmarker tests for pruning scenarios
The obsfate output in cases of pruning is not ideal right now, add some tests
so have these scenarios around.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 17:38:56 +0200] rev 33996
template: better prune support in obsfate
successorssets don't returns good results for pruned commit, add a workaround
for simple cases.
A proper fix would require a large rework of successorssets algorithm, I will
send a separate series for this refactoring.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 15:34:10 +0200] rev 33995
template: compute dates in obsfatedate
Extract the dates from obsmarkers. Compute the min and max date from the
obsmarker range list.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 15:34:00 +0200] rev 33994
template: compute user in obsfateusers
Extract, deduplicate users informations from obs markers in order to display
them.
Print all users for the moment, we might want to display users only in verbose
mode later.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 15:33:27 +0200] rev 33993
template: compute verb in obsfateverb
Add a template function obsfateverb which use the markers information to
compute a better obsfate verb.
The current logic behind the obsfate verb is simple for the moment:
- If the successorsets is empty, the changeset has been pruned, for example:
Obsfate: pruned
- If the successorsets length is 1, the changeset has been rewritten without
divergence, for example:
Obsfate: rewritten as 2:
337fec4d2edc, 3:
f257fde29c7a
- If the successorsets length is more than 1, the changeset has diverged, for
example:
Obsfate: split as 2:
337fec4d2edc, 3:
f257fde29c7a
As the divergence might occurs on a subset of successors, we might see some
successors twice:
Obsfate: split as 9:
0b997eb7ceee, 5:
dd800401bd8c, 10:
eceed8f98ffc; split
as 8:
b18bc8331526, 5:
dd800401bd8c, 10:
eceed8f98ffc
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 17:16:13 -0400] rev 33992
contrib: add test-check-module-imports.t to the Python 3 whitelist
This has the benefit of also catching most (if not all!) old-style
print statements and except statements.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 17:15:20 -0400] rev 33991
tests: update test-obsolete to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 17:15:14 -0400] rev 33990
tests: update test-largefiles-cache to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 17:15:09 -0400] rev 33989
tests: update test-inherit-mode to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 17:11:30 -0400] rev 33988
tests: update test-relink to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:26 -0400] rev 33987
tests: update test-strip to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:21 -0400] rev 33986
tests: update test-share to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:17 -0400] rev 33985
tests: update test-requires to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:12 -0400] rev 33984
tests: update test-progress to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:06 -0400] rev 33983
tests: update test-patchbomb to pass our import checker
Augie Fackler <augie@google.com> [Mon, 28 Aug 2017 17:40:03 -0400] rev 33982
merge with stable
Michael Bolin <mbolin@fb.com> [Wed, 23 Aug 2017 18:24:57 +0000] rev 33981
dirstate: perform transactions with _copymap using single call, where possible
This replaces patterns such as this:
```
if f in self._copymap:
del self._copymap[f]
```
with this:
```
self._copymap.pop(f, None)
```
Although eliminating the extra lookup/call may be a negligible performance win
in the standard dirstate, alternative implementations, such as
[sqldirstate](https://bitbucket.org/facebook/hg-experimental/src/default/sqldirstate/)
may see a bigger win where each of these calls results in an RPC,
so the savings is greater.
Test Plan:
`make tests`
Differential Revision: https://phab.mercurial-scm.org/D493
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 20:25:16 -0700] rev 33980
pull: do not prompt "hg update" if update.requiredest is set
Previously, after pull, we show:
(run 'hg update' to get a working copy)
unconditionally. People might run `hg update` and get an exception if
`update.requiredest` is set, and get a bit frustrated. This patch changes
the code to not prompt `hg update` in that case.
Differential Revision: https://phab.mercurial-scm.org/D516
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Aug 2017 22:05:10 -0700] rev 33979
changelog: abort on attempt to write wdir revision
Similar to the previous patch which prevented writing the null
revision to any revlog, but this is for the wdir revision.
Thanks to Jun for pointing this out.
Differential Revision: https://phab.mercurial-scm.org/D524
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 17:44:08 -0700] rev 33978
phabsend: show associated Differential Revisions with --confirm
Often people running `phabsend --confirm` just want to check whether a
commit will trigger a creation of new Differential Revision, or update an
existing one. This patch implements that. The `--confirm` message was
changed to use node instead of revision number to be consistent with what
`phabsend` outputs.
An example output looks like:
D487 -
a80f447973a0 test-extension: enable demandimport explicitly
D494 -
cf440ea6e47e test-casecollision-merge: fix the test
NEW -
0a6b97147128 phabsend: polish the docstring a bit
Send the above changes to https://phab.mercurial-scm.org/ (yn)?
Differential Revision: https://phab.mercurial-scm.org/D514
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 17:31:33 -0700] rev 33977
phabsend: print the actual URL with --confirm
Sometimes people have multiple Phabricator endpoints set in multiple repos.
It seems better for `--confirm` to prompt about the Phabricator endpoint
patches being sent to.
Differential Revision: https://phab.mercurial-scm.org/D513
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 17:25:18 -0700] rev 33976
phabsend: detect patch change with larger context
Previously phabsend has an optimization that will skip uploading a diff if
the patch (with context line number = 1) remains unchanged. That could be
confusing:
Aug 24 15:52:28 <martinvonz> phillco: something is wrong with phabricator'your patches/
Aug 24 15:52:45 <martinvonz> ... with phabricator's view of your patches again
Aug 24 15:53:38 <martinvonz> if i phabread D388 and then D399, i get a version of filemerge.py with "a, b, c" somewhere on line 344, which is not what phabricator shows for D399
Aug 24 15:53:51 <martinvonz> junw: maybe that's more for you ^
Fix that by checking context with 32767 lines, which is the same as what
will be actually sent.
Differential Revision: https://phab.mercurial-scm.org/D512
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 16:52:28 -0700] rev 33975
phabsend: make --amend the default
The local tag feature was intended to make `phabsend` closer to `email`
workflow. But its experience is not great in multiple ways:
- after rebase, obsoleted changesets are still visible because of tags
- without obsstore, the association information will get lost
- even with obsstore, things could go wrong with graft, export+import
- no easy way to tell which Differential Revision a commit is associated
Therefore make `--amend` the default. People wanting the old behavior can
use `--no-amend`.
Differential Revision: https://phab.mercurial-scm.org/D511
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 17:26:10 -0700] rev 33974
phabsend: polish the docstring a bit
Differential Revision: https://phab.mercurial-scm.org/D510
Peter Vitt <peter.vitt2@uni-siegen.de> [Mon, 28 Aug 2017 13:43:31 +0200] rev 33973
record: make the m key open an editor for the commit message (
issue5667)
With the former crecord extension, the user could edit the commit
message while he was de-/selecting hunks. By pressing 'm', an editor
showed up to edit the commit message.
With record being part of mercurial, this feature is not available
anymore. However, the help text still mentions it.
As the infrastructure needed is still present, this feature is quite
easily ported from the crecord extension to mercurial.
It seems there is no test coverage for record ui, so I tested this patch
manually on my local machine.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:59:02 -0400] rev 33972
tests: update test-patch to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:57 -0400] rev 33971
tests: update test-pager to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:52 -0400] rev 33970
tests: update test-obsolete to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:47 -0400] rev 33969
tests: update test-notify to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:43 -0400] rev 33968
tests: update test-merge1 to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:37 -0400] rev 33967
tests: update test-merge-symlinks to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:28 -0400] rev 33966
tests: update test-logtoprocess to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:22 -0400] rev 33965
tests: update test-log to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:13 -0400] rev 33964
tests: update test-log-exthook to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:58:07 -0400] rev 33963
tests: update test-largefiles-wireproto to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:57:37 -0400] rev 33962
tests: update test-largefiles-small-disk to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:47 -0400] rev 33961
tests: update test-keyword to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:37 -0400] rev 33960
tests: update test-impexp-branch to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:30 -0400] rev 33959
tests: update test-help to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:24 -0400] rev 33958
tests: update test-hardlinks to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:18 -0400] rev 33957
tests: update test-glog to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:12 -0400] rev 33956
tests: update test-fncache to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:51:06 -0400] rev 33955
tests: update test-eol to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:50:59 -0400] rev 33954
tests: update test-dirstate to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:50:35 -0400] rev 33953
tests: update test-debugcommands to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:50:27 -0400] rev 33952
tests: update test-convert-clonebranches to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:50:01 -0400] rev 33951
tests: update test-commit to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:49:54 -0400] rev 33950
tests: update test-command-template to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:49:20 -0400] rev 33949
tests: update test-chg to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:05:51 -0400] rev 33948
tests: update test-bundle2-format to pass import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:04:36 -0400] rev 33947
tests: update test-bundle2-pushback to pass the import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:04:14 -0400] rev 33946
tests: update test-bookmarks to pass the import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:58:39 -0400] rev 33945
tests: update test-bisect to pass our module import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:58:21 -0400] rev 33944
tests: update test-archive to pass our module import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:58:10 -0400] rev 33943
tests: update test-annotate to pass our module import checker
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 03:56:53 +0200] rev 33942
obsolete: fix old typo
Clean an old typo in successorssets.
Differential Revision: https://phab.mercurial-scm.org/D531
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 03:54:24 +0200] rev 33941
obsolete: move merge logic on the smaller object
Refactor some logic in _succs in order to clean successorssets code.
Differential Revision: https://phab.mercurial-scm.org/D530
Rishabh Madan <rishabhmadan96@gmail.com> [Mon, 28 Aug 2017 04:11:58 +0530] rev 33940
releasenotes: view admonition titles using -l flag
Since this extension is fairly new for almost all the contributors, remembering
the admonition (with titles) is difficult. The list (-l) flag provides
a list of all the active admonitions along with titles.
For usage, hg releasenotes -l returns the list.
Differential Revision: https://phab.mercurial-scm.org/D454
Martin von Zweigbergk <martinvonz@google.com> [Sat, 26 Aug 2017 16:00:07 -0700] rev 33939
tests: move baduisetup test inside "#if demandimport"
The test case depends on the failure happening not at import time, but
at uisetup() time, so it doesn't make sense when demandimport is
disabled.
There was already a section for testing demandimport stuff, so I moved
it inside that existing section. As part of the move, I enabled the
extension using '--config' so subsequent tests don't get the bad
extension enabled.
Differential Revision: https://phab.mercurial-scm.org/D526
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Aug 2017 15:50:07 -0700] rev 33938
revlog: abort on attempt to write null revision
My repo got corrupted yesterday by something that ended up writing the
null revision to the revlog (nullid hash, not nullrev index, of
course). We use many extensions internally (narrowhg, remotefilelog,
evolve, internal extensions) and treemanifests are on. The null
revision was written to the changelog, the root manifest log, and one
subdirectory manifest log. I have no idea exactly why the null
revision was written, but it seems cheap enough to check that we
should fail instead of corrupting the repo.
Differential Revision: https://phab.mercurial-scm.org/D522
Martin von Zweigbergk <martinvonz@google.com> [Tue, 22 Aug 2017 23:39:05 -0700] rev 33937
context: remove unnecessary default values for matchers (API)
ctx._dirstatestatus() is called only from workingctx._buildstatus()
and that function, in turn, is called only from
basectx.status(). basectx.status() will always pass a matcher to
_buildstatus(), so there's no need to handle a None matcher there.
Differential Revision: https://phab.mercurial-scm.org/D492
Martin von Zweigbergk <martinvonz@google.com> [Tue, 22 Aug 2017 23:27:55 -0700] rev 33936
context: always pass a matcher into _matchstatus() (API)
This just makes it a little easier to follow and removes the need to
call the superclass's method in workingctx.
Differential Revision: https://phab.mercurial-scm.org/D491
Jun Wu <quark@fb.com> [Wed, 23 Aug 2017 11:30:25 -0700] rev 33935
test-casecollision-merge: fix the test
D30 (
055fee3547df) makes the error message unpredictable, therefore the fix.
Differential Revision: https://phab.mercurial-scm.org/D494
Jun Wu <quark@fb.com> [Sun, 20 Aug 2017 09:46:27 -0700] rev 33934
run-tests: make per-line condition support testcase names
7340465bd added multiple test cases support. The latter has a problem -
output lines cannot be made conditional with `#if`:
```
# COUNTEREXAMPLE: DOES NOT WORK
#testcases A B
$ command-foo
common ouput
#if A
A's ouput
#else
B's ouput
#endif
common ouput
```
That's not trivial to fix (even if it works in test, `run-tests.py -i` may
be suboptimal because diff algorithm does not know how to skip the `#if`
lines, even if it does, it may have trouble figuring out whether a changed
line belongs to inside a `#if` block or outside).
Matching output lines conditionally is useful.
4eec2f04a added per-line
condition support for hghave. This patch extends that to also support test
case names.
Differential Revision: https://phab.mercurial-scm.org/D466
Phil Cohen <phillco@fb.com> [Fri, 25 Aug 2017 13:49:17 -0700] rev 33933
simplemerge: refactor _picklabels to be more compact
Use @martinvonz's suggestion from D376.
Differential Revision: https://phab.mercurial-scm.org/D521
Phil Cohen <phillco@fb.com> [Fri, 25 Aug 2017 13:49:16 -0700] rev 33932
simplemerge: remove check for null context
Differential Revision: https://phab.mercurial-scm.org/D520
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Aug 2017 22:20:02 +0900] rev 33931
run-tests: pass unicode to Pygments
This is required on Python 3, and is more correct on Python 2 because
Pygments is a unicode library.
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Aug 2017 22:15:40 +0900] rev 33930
run-tests: factor out highlight functions
Yuya Nishihara <yuya@tcha.org> [Thu, 24 Aug 2017 22:09:57 +0900] rev 33929
run-tests: include "\n" in formatted message instead of calling writeln()
So we don't have to strip "\n" from pygments output.
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 13:08:58 +0900] rev 33928
encoding: add fast path of from/toutf8b() for ASCII strings
See the previous patch for why.
The added test seems not making much sense because ASCII strings should
never contain "\xed" and be valid UTF-8.
(with mercurial repo)
$ export HGRCPATH=/dev/null HGPLAIN=
$ hg log --time --config experimental.stabilization=all -Tjson > /dev/null
(original)
time: real 6.830 secs (user 6.740+0.000 sys 0.080+0.000)
time: real 6.690 secs (user 6.650+0.000 sys 0.040+0.000)
time: real 6.700 secs (user 6.640+0.000 sys 0.060+0.000)
(fast jsonescape)
time: real 5.630 secs (user 5.550+0.000 sys 0.070+0.000)
time: real 5.700 secs (user 5.650+0.000 sys 0.050+0.000)
time: real 5.690 secs (user 5.640+0.000 sys 0.050+0.000)
(this patch)
time: real 5.190 secs (user 5.120+0.000 sys 0.070+0.000)
time: real 5.230 secs (user 5.170+0.000 sys 0.050+0.000)
time: real 5.220 secs (user 5.150+0.000 sys 0.070+0.000)
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 13:06:23 +0900] rev 33927
encoding: add fast path of from/tolocal() for ASCII strings
This is micro optimization, but seems not bad since to/fromlocal() is called
lots of times and isasciistr() is cheap and simple.
We boldly assume that any non-ASCII characters have at least one 8-bit byte.
This isn't true for some email character sets (e.g. ISO-2022-JP and UTF-7),
but I believe no such encodings are used as a platform default. Shift_JIS,
a major crap, is okay as it should have a leading byte in 0x80-0xff range.
(with mercurial repo)
$ export HGRCPATH=/dev/null HGPLAIN=
$ hg log --time --config experimental.stabilization=all > /dev/null
(original)
time: real 7.460 secs (user 7.420+0.000 sys 0.030+0.000)
time: real 7.670 secs (user 7.590+0.000 sys 0.080+0.000)
time: real 7.560 secs (user 7.510+0.000 sys 0.040+0.000)
(this patch)
time: real 7.340 secs (user 7.260+0.000 sys 0.060+0.000)
time: real 7.260 secs (user 7.210+0.000 sys 0.030+0.000)
time: real 7.310 secs (user 7.260+0.000 sys 0.060+0.000)
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 12:59:42 +0900] rev 33926
encoding: add function to test if a str consists of ASCII characters
Most strings are ASCII. Let's optimize for it.
Using uint64_t is slightly faster than uint32_t on 64bit system, but there
isn't huge difference.
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 14:47:52 +0900] rev 33925
encoding: add fast path of jsonescape() (
issue5533)
This isn't highly optimized as it copies characters one by one, but seems
reasonably simple and not slow.
(with mercurial repo)
$ export HGRCPATH=/dev/null HGPLAIN=
$ hg log --time --config experimental.stabilization=all -Tjson > /dev/null
(original)
time: real 6.830 secs (user 6.740+0.000 sys 0.080+0.000)
time: real 6.690 secs (user 6.650+0.000 sys 0.040+0.000)
time: real 6.700 secs (user 6.640+0.000 sys 0.060+0.000)
(this patch)
time: real 5.630 secs (user 5.550+0.000 sys 0.070+0.000)
time: real 5.700 secs (user 5.650+0.000 sys 0.050+0.000)
time: real 5.690 secs (user 5.640+0.000 sys 0.050+0.000)
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 16:10:51 +0900] rev 33924
encoding: extract stub for fast JSON escape
This moves JSON character maps to pure/charencode.py because they will be
used only when the fast-path fails.
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 21:43:54 -0700] rev 33923
journal: do not use atomictemp (
issue5338)
Writing journal files using `atomictemp` leads to quadratic performance that
could be problematic if automation runs many commands. Other logs like
blackbox does not use atomictemp, and journal logs are not critical for repo
correctness. So let's make them non-atomictemp.
Differential Revision: https://phab.mercurial-scm.org/D517
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:26:25 -0400] rev 33922
tests: update test-commandserver to pass our import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:37:56 -0400] rev 33921
tests: add blank output lines to test-commandserver
This helps the import checker notice when a Python heredoc has
ended. It's not perfect, but it gets nasty quick and I think the
better fix would be to add a real parser for .t-tests, which will have
to wait.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:37:06 -0400] rev 33920
contrib: make import-checker agree more with run-tests about heredocpy
run-tests.py and import-checker.py take wholly different approaches to
.t-tests, and the result was that they had different notions about
when a Python heredoc had ended, leading to conflicts. This resolves
part of the issue, and the rest I can deal with by tweaking the one
offending test file.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:28:54 -0400] rev 33919
contrib: add bzrlib to list of packages from which we import symbols
Helps some tests pass the import checker.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:50:53 -0400] rev 33918
tests: ensure demandimport test uses absolute_import
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:16:58 -0400] rev 33917
tests: blacklist test-demandimport from test-check-module-imports
It just does too much weird import stuff to have a hope of passing the
checks.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:16:09 -0400] rev 33916
tests: sort excluded test files in test-check-module-imports
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:25:06 -0400] rev 33915
contrib: allow symbol imports from hgclient for tests
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:15:16 -0400] rev 33914
tests: blacklist some more entries in module import checks
David Demelier <markand@malikania.fr> [Thu, 24 Aug 2017 09:23:06 +0200] rev 33913
bookmarks: allow deleting active bookmark using '.'
Boris Feld <boris.feld@octobus.net> [Thu, 17 Aug 2017 18:26:11 +0200] rev 33912
template: add minimal obsfate template function
The goal of this series is to have templates capable of displaying the
evolution of a changeset in a clean and human-readable way.
Add the succsandmarkers template return successors and markers so it can be
used separately like this:
> {succsandmarkers % "{get(succsandmarkers, "markers")|json};"}
The following patches will add template functions that takes successors and
markers as inputs and compute various obsfate fields from them.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 03:27:58 +0200] rev 33911
obsolete: track markers in _succs
We now also store markers in _succs. It will be useful for the obsfate template that
will use them to display more meaningful information like the list of users
that have evolved a changeset into its successors.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 03:13:17 +0200] rev 33910
obsolete: add an explicit '_succs.copy()' method
Mimic the standard API for copying in the _succs class, it makes the code
slightly cleaner and will be needed later for copying markers at the same time
than copying the list content.
Boris Feld <boris.feld@octobus.net> [Mon, 03 Jul 2017 00:53:55 +0200] rev 33909
obsolete: introduce a _succs class
It will be useful later when we will be adding markers to _succs in order to
represent a successorset with the list of markers from the root to each
successors sets. This information will be needed for the obsfate template I will
introduce.
Makes it a subclass of list so all callers will continue to work.
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:51 -0700] rev 33908
simplemerge: simplify code now that we always write to a context
There's no need for an `out` abstraction between files and contexts anymore.
Differential Revision: https://phab.mercurial-scm.org/D383
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:51 -0700] rev 33907
simplemerge: make context parameters non-optional
Also update the function docstring.
Differential Revision: https://phab.mercurial-scm.org/D382
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:51 -0700] rev 33906
simplemerge: stop accepting, and passing, file parameters
Differential Revision: https://phab.mercurial-scm.org/D381
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:37 -0700] rev 33905
simplemerge: stop reading from, and writing to, files
We now use contexts first for everything and also pass them everywhere.
Differential Revision: https://phab.mercurial-scm.org/D380
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:37 -0700] rev 33904
simplemerge: use context paths for default labels instead of file paths
This is the last place we used the filepath arguments without first using the
context version.
Differential Revision: https://phab.mercurial-scm.org/D379
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:30:37 -0700] rev 33903
contrib: make simplemerge script pass context-like objects
`simplemerge()` will soon require context-like objects to work. Create a simple
context-like object that wraps the requested files and can be passed to the new
API.
Differential Revision: https://phab.mercurial-scm.org/D378
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:26:40 -0700] rev 33902
simplemerge: use `ctx.decoddeddata()` instead of `repo.wreaddata`
This eliminates the need for the `repo` object.
Differential Revision: https://phab.mercurial-scm.org/D435
Phil Cohen <phillco@fb.com> [Thu, 24 Aug 2017 21:26:40 -0700] rev 33901
context: add `decodeddata()` to basefilectx
This will be used as an abstraction by simplemerge to get the data it used to
read off the filesystem.
Differential Revision: https://phab.mercurial-scm.org/D434
David Demelier <markand@malikania.fr> [Mon, 21 Aug 2017 08:52:46 +0200] rev 33900
bookmarks: allow renaming active bookmark using '.'
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:14:52 -0400] rev 33899
i18n: update check-translation script to pass import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:14:34 -0400] rev 33898
demandimportpy3: update to pass import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 16:02:57 -0400] rev 33897
contrib: always treat importlib.* as stdlib
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:14:19 -0400] rev 33896
hg: update top-level script to use modern import conventions
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:13:13 -0400] rev 33895
simplemerge: update to conform with modern import conventions
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:12:37 -0400] rev 33894
contrib: inform import checker that __builtin__ is a thing
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:12:21 -0400] rev 33893
contrib: allow importing "symbols" from mercurial
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:12:03 -0400] rev 33892
hgperf: update to conform with import style checks
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:11:48 -0400] rev 33891
contrib: update hg-ssh to conform with import style checks
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 12:59:21 -0400] rev 33890
contrib: have import-checker work mostly with native strings for mod names
Module names are a bit awkward to deal with portably otherwise.
Durham Goode <durham@fb.com> [Wed, 23 Aug 2017 12:35:03 -0700] rev 33889
bundlerepo: move bundle2 part handling out to a function
This moves the bundle2 part handling for bundlerepo out to a separate function
so extensions can participate in bundlerepo setup when using bundle2 bundles.
Differential Revision: https://phab.mercurial-scm.org/D290
Durham Goode <durham@fb.com> [Wed, 23 Aug 2017 12:35:03 -0700] rev 33888
bundle2: seek part back during iteration
Previously, iterparts would yield the part to users, then consume the part. This
changed the part after the user was given it and left it at the end, both of
which seem unexpected. Let's seek back to the beginning after we've consumed
it. I tried not seeking to the end at all, but that seems important for the
overall bundle2 consumption.
This is used in a future patch to let us move the bundlerepo
bundle2-changegroup-part to be handled entirely within the for loop, instead of
having to do a seek back to 0 after the entire loop finishes.
Differential Revision: https://phab.mercurial-scm.org/D289
Durham Goode <durham@fb.com> [Wed, 23 Aug 2017 12:34:56 -0700] rev 33887
bundlerepo: move temp bundle creation to a separate function
A future patch will refactor certain parts of bundlerepo initiatlization such
that we need to create temp bundles from another function. Let's move this to
another function to support that.
Differential Revision: https://phab.mercurial-scm.org/D288
Martin von Zweigbergk <martinvonz@google.com> [Thu, 17 Aug 2017 13:04:47 -0700] rev 33886
exchange: don't attempt phase exchange if phase-heads was in bundle
The Mercurial core server doesn't yet include phase-heads parts in the
bundle, but our Google-internal server wants to do
that. Unfortunately, the usual exchange still happens even if
phase-heads part is included (including the short-circuited one for
old/publishing servers). That means that even if our server (again,
the Google-internal one, but also future Mercurial core servers)
includes a phase-heads part to indicate that some heads should be
drafts, that would still get overwritten by the phase updating that
happens after. So let's fix that by marking the phase step done if we
receive at least one phase-heads part in the bundle.
Differential Revision: https://phab.mercurial-scm.org/D440
Jun Wu <quark@fb.com> [Wed, 16 Aug 2017 15:48:48 -0700] rev 33885
pushvars: do not mangle repo state
Setting `repo._shellvars` works but is not a clean way to pass the pushvars
information from the push command to the exchange operation. Therefore
change it to actually pass `pushvars` as a push operation argument instead.
This makes third party extension like remotenames easier to support pushvars
cleanly. The key value parsing and verification code has been moved to a
lower level so it's harder to be bypassed and easier to be used in
remotenames which could replace `push` command entirely.
Differential Revision: https://phab.mercurial-scm.org/D423
Jun Wu <quark@fb.com> [Sun, 27 Aug 2017 13:39:17 -0700] rev 33884
record: fix revert -i for lines without newline (
issue5651)
This is a regression caused by
66117dae87f9. Code prior to
66117dae87f9
seems to miss the "\ No newline at end of file" line.
Differential Revision: https://phab.mercurial-scm.org/D528
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 21 Aug 2017 16:43:37 +0530] rev 33883
morestatus: check whether the conflict message is None before printing
There are cases like bisect when the conflict message can be None. So we make
sure that we don't print None in that case.
Thanks to Martin for catching this.
Differential Revision: https://phab.mercurial-scm.org/D461
Alex Gaynor <alex.gaynor@gmail.com> [Wed, 23 Aug 2017 01:09:08 +0000] rev 33882
bundle2: fixed usage of an attribute that was removed in py3k
Differential Revision: https://phab.mercurial-scm.org/D482
Rishabh Madan <rishabhmadan96@gmail.com> [Sun, 13 Aug 2017 19:58:45 +0530] rev 33881
releasenotes: add check flag for use of admonitions and its validity
While using releasenotes extension, we will be using admonitions in commit messages.
The check (-c) flag will look for an admonition within the message. If it exists, it will
verify if it is stated under default or custom admonition. The check fails if the
admonition is not present in any of them. It also suggests similar admonitions
in case the admonition is invalid.
Differential Revision: https://phab.mercurial-scm.org/D368
Gábor Stefanik <gabor.stefanik@nng.com> [Tue, 22 Aug 2017 16:16:39 +0200] rev 33880
copies: fix misaligned lines
Gábor Stefanik <gabor.stefanik@nng.com> [Tue, 22 Aug 2017 16:08:31 +0200] rev 33879
copies: fix typo in comment
"will not be limited" was meant to be "will not be visited". I missed this
when writing the original graft-through-rename patch series.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 11:00:46 -0400] rev 33878
python3: whitelist test-imports-checker.t, which now passes
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 12:58:28 -0400] rev 33877
contrib: make import checker always think in terms of bytes
The doctests now do some regrettable things, but they'll always work
since we're dealing with ASCII module names etc.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 10:58:29 -0400] rev 33876
contrib: work around some modules not existing on Py3 in import checker
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 15:05:07 -0400] rev 33875
tests: stop using old except syntax in test-bundle2-format
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:57:52 -0400] rev 33874
tests: update test-archive to always use hashlib
We don't need the fallback to the old modules anymore.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 14:57:10 -0400] rev 33873
md5sum: assume hashlib exists now that we're 2.7 only
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 12:58:51 -0400] rev 33872
undumprevlog: update to valid Python 3 syntax
I didn't do anything to ensure correctness here, just enough to avoid
tracebacks in the import checker, which uses the native ast module to
try and parse all our Python files.
Alex Gaynor <alex.gaynor@gmail.com> [Wed, 23 Aug 2017 01:08:09 +0000] rev 33871
tests: fixed a bytes/unicode confusion in the test runner
Differential Revision: https://phab.mercurial-scm.org/D483
Martin von Zweigbergk <martinvonz@google.com> [Tue, 22 Aug 2017 10:01:27 -0700] rev 33870
run-tests: remove unused pygments token type
Differential Revision: https://phab.mercurial-scm.org/D478
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Aug 2017 22:13:51 -0700] rev 33869
run-tests: also highlight .py test files in summary messages
With the .t files highlighted, it's very easy to not even notice
failed .py tests.
Differential Revision: https://phab.mercurial-scm.org/D471
Jun Wu <quark@fb.com> [Sun, 20 Aug 2017 10:55:05 -0700] rev 33868
test-revset: make it work with chg
chg currently triggers `reposetup` as a side effect of `hg serve` command.
Therefore change the test to not output during `reposetup` to be compatible
with chg.
Differential Revision: https://phab.mercurial-scm.org/D455
Yuya Nishihara <yuya@tcha.org> [Sat, 19 Aug 2017 11:23:33 +0900] rev 33867
copies: use intersectmatchers() in non-merge p1 optimization
This enables the optimization introduced by
d4247c306d82 for non-rebase cases.
Before, the match couldn't be narrowed if it was e.g. alwaysmatcher.
The logic is copied from
bd56bea5ecf8.
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Tue, 22 Aug 2017 11:00:00 +0200] rev 33866
run-tests: pre instantiate pygments objects
Pre instantiate pygments objects to minimize overhead (cf.
20436925e080)
Sean Farley <sean@farley.io> [Mon, 21 Aug 2017 21:35:06 -0700] rev 33865
merge with stable
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 01:34:11 -0700] rev 33864
rebase: only change self.state when collapsing in _finishrebase
When the code executes to _finishrebase, self.state should be populated with
correct destinations and do not need to be written to a node. The code was
introduced by
8dc45c9059, which seems to avoid setting state values to None
but it didn't provide more details.
Differential Revision: https://phab.mercurial-scm.org/D346
Jun Wu <quark@fb.com> [Thu, 10 Aug 2017 22:17:15 -0700] rev 33863
rebase: choose merge base without unwanted revisions
Previously, when there are 2 merge base candidates, we choose p1 blindly,
which may make the merge result to have "unwanted content". This patch makes
rebase smarter - choose a merge base that does not have "unwanted revs" if
possible. Since we don't really have a good solution when there are
"unwanted revs", abort in that case.
Differential Revision: https://phab.mercurial-scm.org/D340
Martin von Zweigbergk <martinvonz@google.com> [Tue, 15 Aug 2017 23:23:55 -0700] rev 33862
templatekw: choose {latesttag} by len(changes), not date (
issue5659)
As Augie reported in the bug, the current heuristic of choosing the
best tag of a merge commit by taking the one with newest tag (in terms
of tagging date) currently fails in the Mercurial repo itself. Copying
the example from Yuya:
$ hg glog -T '{node|short} {latesttag}+{latesttagdistance}\n' \
-r '4.2.3: & (merge() + parents(merge()) + tag())'
o
02a745c20121 4.2.3+5
|\
| o
86aca74a063b 4.2.3+4
| |\
| | o
e6d8ee3c9ec3 4.3-rc+109
| | |
| | ~
o |
a3ce07e2dde5 4.3.1+2
: |
o |
3fee7f7d2da0 4.3.1+0
|/
o
98e990bb7330 4.2.3+3
|\
| ~
o
506d7e48fbe6 4.2.3+2
:
o
943c91326b23 4.2.3+0
|
~
It seems to me like the best choice is the tag with the smallest
number of changes since it (across all paths, not the longest single
path). So that's what this patch does, even though it's
costly. Best-of-5 timings for Yuya's command above shows a slowdown
from 1.293s to 1.610s. We can optimize it later.
Differential Revision: https://phab.mercurial-scm.org/D447
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Aug 2017 12:50:26 -0700] rev 33861
tests: use graph log in {latesttag} tests
The tests are much easier to read if one does not have to re-read the
setup part all the time to understand the graph shape.
Differential Revision: https://phab.mercurial-scm.org/D446
Jun Wu <quark@fb.com> [Wed, 16 Aug 2017 10:44:06 -0700] rev 33860
demandimport: disable if chg is being used
In chg's case, making modules lazily loaded could actually slow down things
since chg pre-imports them. Therefore disable demandimport if chg is being
used.
This is not done by setting `HGDEMANDIMPORT` chg client-side because that
has side-effects on child processes (hooks, etc).
Differential Revision: https://phab.mercurial-scm.org/D351
Jun Wu <quark@fb.com> [Fri, 18 Aug 2017 11:08:17 -0700] rev 33859
demandimport: move HGDEMANDIMPORT test to __init__.py
The logic is now shared between demandimport{2,3}.
Differential Revision: https://phab.mercurial-scm.org/D445
Danny Hooper <hooper@google.com> [Tue, 15 Aug 2017 10:15:31 -0700] rev 33858
log: add a "graphwidth" template variable
Wrapping text in templates for 'hg log --graph' can't be done very well,
because the template doesn't know how wide the graph drawing is. The edge
drawing function needs to know the number of lines in the template output, so
we need to also determine how wide that drawing would be before we call the
edgefn or evaluate the template.
This patch makes edgefn compute the graph width and pass it into the template
so that we can do something like this:
COLUMNS=10 hg log --graph --template "{fill(desc, termwidth - graphwidth)}"
@ a a a a
| a a a a
| a a a a
o a a a
|\ a a a
| | a a a
| | a a a
Using extensions to do this would be relatively complicated due to a lack of
hooks in this area of the code.
In the future it may make sense to have a more generic "textwidth" that tells
you how many columns you can expect to fill without causing the terminal to
wrap your output. I'm not sure there are other situations to motivate this yet,
or if it is entirely feasible.
Differential Revision: https://phab.mercurial-scm.org/D360
Boris Feld <boris.feld@octobus.net> [Wed, 16 Aug 2017 10:18:57 +0200] rev 33857
obsmarker: fix precnode deprecation
The deprecation message for marker.precnode was wrong. Fix the typo.
Differential Revision: https://phab.mercurial-scm.org/D413
Boris Feld <boris.feld@octobus.net> [Wed, 16 Aug 2017 10:26:26 +0200] rev 33856
obsmarker: precnode was renamed into prednode
Update all calls to formatter.write first arguments to remove references to
precnode and use prednode consistently everywhere.
Differential Revision: https://phab.mercurial-scm.org/D414
Boris Feld <boris.feld@octobus.net> [Wed, 16 Aug 2017 16:48:41 +0200] rev 33855
revset: mark evolution-related revsets as experimental
Differential Revision: https://phab.mercurial-scm.org/D416
Jun Wu <quark@fb.com> [Tue, 15 Aug 2017 17:22:57 -0700] rev 33854
push: fix docsstring
Seems the code block misses `::`. This patch makes sure `[push]` and
`pushvars.server = true` are in two lines.
Differential Revision: https://phab.mercurial-scm.org/D411
Yuya Nishihara <yuya@tcha.org> [Wed, 16 Aug 2017 13:54:24 +0900] rev 33853
py3: select input or raw_input by pycompat
This seems slightly cleaner.
Yuya Nishihara <yuya@tcha.org> [Wed, 16 Aug 2017 13:50:11 +0900] rev 33852
py3: make encoding.strio() an identity function on Python 2
It's the convention the other encoding.str*() functions follow. To make things
simple, this also drops kwargs from the strio() constructor.
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Aug 2017 14:12:28 +0900] rev 33851
templatekw: specify plural form of instability
Follows up
40739aef97f7.
Yuya Nishihara <yuya@tcha.org> [Wed, 16 Aug 2017 13:57:19 +0900] rev 33850
templatekw: rename termwidth() per convention
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 01:08:07 -0700] rev 33849
rebase: optimize "source" calculation in adjustdest
The "source" variable is calculated inside a loop but it does not depend on
loop variables. Therefore move it outside the loop.
Differential Revision: https://phab.mercurial-scm.org/D345
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 01:36:59 -0700] rev 33848
rebase: remove "state >= revtodo" condition
Now the minimal value of state is revtodo, that condition is always true,
therefore removed.
Differential Revision: https://phab.mercurial-scm.org/D344
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 01:05:47 -0700] rev 33847
rebase: remove self.destancestors
The state is no longer used after calculating "self.external", therefore
removed.
Differential Revision: https://phab.mercurial-scm.org/D343
Jun Wu <quark@fb.com> [Fri, 14 Jul 2017 09:01:45 -0700] rev 33846
rebase: remove rebaseset from _checkobsrebase
The parameter is not used. Therefore removed.
Differential Revision: https://phab.mercurial-scm.org/D85
Jun Wu <quark@fb.com> [Mon, 10 Jul 2017 12:18:32 -0700] rev 33845
rebase: remove revignored and nullmerge states
They are no longer necessary to make rebase behavior correct. Therefore
remove them to make the code cleaner and easier to reason about.
Differential Revision: https://phab.mercurial-scm.org/D26
Jun Wu <quark@fb.com> [Sat, 08 Jul 2017 20:38:34 -0700] rev 33844
rebase: remove messages for nullmerge and revignored (BC)
These states will be removed to make the code cleaner and more robust.
Remove their messages first to make review easier.
Differential Revision: https://phab.mercurial-scm.org/D25
Jun Wu <quark@fb.com> [Sat, 08 Jul 2017 20:38:34 -0700] rev 33843
rebase: remove revprecursor and revpruned states (BC)
Those states are no longer necessary for rebase to function properly. Remove
them to make the code cleaner.
Marked as BC because in a corner case where working parent is obsoleted, and
is skipped for rebase, we no longer move working parent after rebase
completes. That is better since if working parent is obsoleted, it should be
the user moving working parent back there (after a rebase) explicitly, in
that case, we shouldn't move working parent again.
Differential Revision: https://phab.mercurial-scm.org/D24
Jun Wu <quark@fb.com> [Sat, 08 Jul 2017 20:14:33 -0700] rev 33842
rebase: move obsoleted not rebased messages earlier (BC)
A later patch will clean up those states. This patch moves the messages
earlier.
Marked as BC since the order of message has changed.
Differential Revision: https://phab.mercurial-scm.org/D23
Jun Wu <quark@fb.com> [Sat, 08 Jul 2017 20:05:52 -0700] rev 33841
rebase: extract ctx description logic to a function
The function will be used in a later patch.
Differential Revision: https://phab.mercurial-scm.org/D22
Augie Fackler <augie@google.com> [Thu, 27 Jul 2017 00:00:15 -0400] rev 33840
python3: whitelist another *13* tests that now pass
Differential Revision: https://phab.mercurial-scm.org/D302
Augie Fackler <augie@google.com> [Mon, 24 Jul 2017 14:38:40 -0400] rev 33839
py3: introduce a wrapper for __builtins__.{raw_,}input()
In order to make this work, we have to wrap the io streams in a
TextIOWrapper so that __builtins__.input() can do unicode IO on Python
3. We can't just restore the original (unicode) sys.std* because we
might be running a cmdserver, and if we blindly restore sys.* to the
original values then we end up breaking the cmdserver. Sadly,
TextIOWrapper tries to close the underlying stream during its __del__,
so we have to make a sublcass to prevent that.
If you see errors like:
TypeError: a bytes-like object is required, not 'str'
On an input() or print() call on Python 3, the substitution of
sys.std* is probably the root cause.
A previous version of this change tried to put the bytesinput() method
in pycompat - it turns out we need to do some encoding handling, so we
have to be in a higher layer that's allowed to use
mercurial.encoding.encoding. As a result, this is in util for now,
with the TextIOWrapper subclass hiding in encoding.py. I'm not sure of
a better place for the time being.
Differential Revision: https://phab.mercurial-scm.org/D299
Augie Fackler <augie@google.com> [Wed, 26 Jul 2017 23:33:26 -0400] rev 33838
python3: whitelist four more passing tests
Differential Revision: https://phab.mercurial-scm.org/D298
Augie Fackler <augie@google.com> [Fri, 11 Aug 2017 15:09:54 -0400] rev 33837
extensions: don't give AttributeError bytes message on Python 3
Differential Revision: https://phab.mercurial-scm.org/D353
Augie Fackler <augie@google.com> [Tue, 25 Jul 2017 22:49:43 -0400] rev 33836
extensions: if on py3 and propname is a bytestr, convert to sysstr
Property names are unicodes on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D296
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 12 Aug 2017 04:47:40 +0530] rev 33835
pushvars: add a coreconfigitem for push.pushvars.server
Differential Revision: https://phab.mercurial-scm.org/D359
Jun Wu <quark@fb.com> [Tue, 18 Jul 2017 02:05:19 -0700] rev 33834
phabricator: add phabupdate command to update status in batch
Changing status (accept, etc) on the webpage is not very convenient -
currently there is no way to accept (or abandon etc.) a stack using a single
click or command.
This patch adds a `phabupdate` command that could be used to change status
in batch. It also supports `--comment` which will write a comment on the
last revision, which is similar to what we do using emails.
Differential Revision: https://phab.mercurial-scm.org/D127
Jun Wu <quark@fb.com> [Tue, 18 Jul 2017 01:34:55 -0700] rev 33833
phabricator: add status to revision query language
This patch adds status words (ex. `abandoned`, `accepted`, `needsreview`,
`needsrevision`, `closed`) to the revision query language so people can
select revision in a more flexible way.
Test Plan:
Try something like `phabread ':2 & accepted'`, `phabread ':105 - closed` and
make sure they have desired outputs.
Differential Revision: https://phab.mercurial-scm.org/D126
Jun Wu <quark@fb.com> [Mon, 17 Jul 2017 23:19:11 -0700] rev 33832
phabricator: add a small language to query Differential Revisions
Previously, `phabread` can only be used to read a single patch, or a single
stack of patches. In the future, we want to have more complex queries like
filtering with status (open, accepted, closed, etc), or maybe more complex
like filtering by reviewers etc. The command line flag approach won't scale
with that.
Besides, we might want to have other commands to update Differential
Revision status in batch, like accepting a stack using a single command.
Therefore, this patch adds a small language. It has basic set operations:
`&`, `+`, `-` and an ancestor operator to support `--stack`.
Test Plan:
Try querying this Phabricator instance:
hg phabread 1+2 # 1, 2
hg phabread D2+D1 # 2, 1
hg phabread ':118-115+:2-1' # 114, 116, 117, 118, 2
hg phabread '((:118-(D115+117)))&:117' # 114, 116
hg phabread ':2&:117' --debug # differential.query is called only once
Make sure the output is expected and prefetch works.
Differential Revision: https://phab.mercurial-scm.org/D125
Jun Wu <quark@fb.com> [Mon, 17 Jul 2017 23:14:06 -0700] rev 33831
phabricator: change "readpatch" to be more flexible
Previously, `readpatch` and `querydrev` take a same `params` and `stack`
parameters. This patch changes `readpatch` so it takes the output of
`querydrev`, not the input of `querydrev`. This makes the code more
flexible and cleaner.
Differential Revision: https://phab.mercurial-scm.org/D124
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 22:46:16 -0700] rev 33830
filemerge: extract `_picklabels` as a helper function
This shortens `simplemerge()` and is a bit cleaner, IMO.
Differential Revision: https://phab.mercurial-scm.org/D376
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 22:46:03 -0700] rev 33829
simplemerge: write merge result to the localctx, if passed
Differential Revision: https://phab.mercurial-scm.org/D375
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 20:06:52 -0700] rev 33828
simplemerge: use contexts to read file data from, if passed
Differential Revision: https://phab.mercurial-scm.org/D374
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 20:06:52 -0700] rev 33827
filemerge: pass contexts to simplemerge
Otherwise, this should be a no-op.
Differential Revision: https://phab.mercurial-scm.org/D373
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 20:06:52 -0700] rev 33826
simplemerge: add optional context parameters to simplemerge
Rename the existing parameters for clarity.
These will, in subsequent patches, allow callers to redirect reads (of the
three sides of the merge) and writes (of the result) to the given contexts,
instead of using the filesystem.
While in most cases, the writes will go to a workingfilectx, this opens the
door for it to be a memfilectx in the case of an in-memory merge.
Repo will be necessary in a subsequent comit.
Differential Revision: https://phab.mercurial-scm.org/D372
Phil Cohen <phillco@fb.com> [Sun, 13 Aug 2017 20:06:52 -0700] rev 33825
simplemerge: extract verifytext as a helper function
This will be used in a subsequent commit.
Differential Revision: https://phab.mercurial-scm.org/D371
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 23:26:54 -0700] rev 33824
commit: use context manager with dirstateguard
When I wrote
5ac845ca059a (commit: don't let failed commit with
--addremove update dirstate (
issue5645), 2017-07-31), Durham's
609606d21765 (rebase: use one dirstateguard for when using
rebase.singletransaction, 2017-07-20) had not yet landed, so I had to
write it in the old-fashioned way. Now that Durham's patch is in, we
can simplify by using a context manager.
Differential Revision: https://phab.mercurial-scm.org/D406
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 23:26:51 -0700] rev 33823
commit: move dirstateguard creation out of try-block
This is just a simple refactoring to make the next patch simpler. If
the dirstateguard constructor raises an exception, the finally-block
won't do anything anyway, so this is functionally equivalent (and
there is no except-block).
Differential Revision: https://phab.mercurial-scm.org/D405
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 16 Aug 2017 00:25:20 +0530] rev 33822
copies: add more details to the documentation of mergecopies()
This documentation is very helpful for any developer to understand what
copytracing is and what the function does. Since this is the main function of
doing copytracing, I have also included bits about copytracing in it.
This additions are picked from a doc by Stash@Fb. So thanks to him.
Differential Revision: https://phab.mercurial-scm.org/D409
Augie Fackler <augie@google.com> [Wed, 26 Jul 2017 17:58:19 -0400] rev 33821
httppeer: add support for httppostargs when we're sending a file
This is probably only used in the 'unbundle' command, but the code
ended up being cleaner to make it generic and treat *all* httppostargs
with a non-args request body as though they were file-like in
nature. It also means we get test coverage more or less for free. A
previous version of this change didn't use io.BytesIO, and it was a
lot more complicated.
This also fixes a server-side bug, so anyone using httppostargs should
update all of their servers to this revision or later *before* this
gets to their clients, otherwise servers will hang trying to over-read
the POST body.
Differential Revision: https://phab.mercurial-scm.org/D231
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 15 Aug 2017 21:09:33 +0900] rev 33820
i18n: get translation entries for description of each compression engines
Now, hggettext can be applied safely on util.py, of which
i18nfunctions contains appropriate objects related to each compression
types.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 15 Aug 2017 21:06:26 +0900] rev 33819
i18n: ignore docstring for modules under mercurial
Docstring of modules is needed only for "hg help -e EXTNAME".
This is a preparation for applying hggettext on util.py, which has
module docstring, but it isn't needed for translation.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 15 Aug 2017 19:27:24 +0900] rev 33818
i18n: use saved object to get actual function information if available
To list up available compression types instead of
".. bundlecompressionmarker" in "hg help bundlespec" output, proxy
object "docobject" is used, because:
- current online help system requires that __doc__ of registered
object (maybe, function) is already well formatted in reST syntax
- bundletype() method of compressionengine classes is used to list up
available compression types, but
- __doc__ of bundletype() object (= "instancemethod") is read-only
On the other hand, hggettext requires original function object, in
order to get document location in source code.
Therefore, description of each compression types isn't yet
translatable. Even if translatable, translators should make much
effort to determine location of original texts in source code.
To get actual function information, this patch makes hggettext use
function object saved as "_origfunc", if it is available. This patch
also changes bundlecompressiontopics() side, in order to explain how
these changes work easily.
This patch is a part of preparations for making description of each
compression types translatable.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sun, 13 Aug 2017 15:20:16 +0900] rev 33817
i18n: ignore doctest part to avoid warning at "make update-pot"
hggettext assumes that backslashes in docstring are always doubled in
original source code, in order to find the location of original
docstring out certainly.
This assumption almost always works as expected. But doctest easily
breaks it, because many of backslashes in doctests aren't doubled.
This mismatching causes "unknown offset in ..." warning at "make
update-pot".
To avoid such warning, this patch ignores doctest part of docstring
before finding the location of original docstring out.
BTW, at this patch, only person() in templatefilters.py has doctest
part, which causes "unknown offset ..." warning.
Therefore, just making backslashes in that doctest doubled can avoid
such warning, too. But forcing doctest writers to double backslashes
in doctest isn't reasonable, IMHO.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 02 Aug 2017 01:15:07 +0900] rev 33816
largefiles: fix help text to avoid warning at "make update-pot"
This change helps hggettext to find out help text in original source,
because it assumes that backslash ('\') is doubled in docstring.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 02 Aug 2017 01:03:20 +0900] rev 33815
i18n: make hggettext use original docstring to compute offset
Before this patch, hggettext uses __doc__ of each functions to compute
offset of document text.
But __doc__ of many functions is already modified by decorators in
registrar (e.g. @templatekeyword adds ":NAME: " prefix to it), and
hggettext can not find it out in original source.
This causes many "unknown offset in ..." warning at "make update-pot",
and leaving them might cause overlooking serious problems.
This patch makes hggettext use original docstring, which decorators in
registrar save into _origdoc, to compute offset.
Even after this patch, there are still a few "unknown offset in ..."
warning at "make update-pot" for specific reasons. These will be fixed
later one by one.
Matthieu Laneuville <matthieu.laneuville@octobus.net> [Fri, 11 Aug 2017 14:21:49 +0200] rev 33814
run-tests: also color the summary messages (skipped, failed...)
Filip Filmar <filmil@gmail.com> [Sun, 13 Aug 2017 00:17:13 -0700] rev 33813
crecord: fixes the formatting of the select status in the status line
The status line in the crecord has the "space" status field which has variable
length depending on the length of the status label in the language of choice.
In English, the status labels are "space: deselect" and "space:select". The
"deselect" label is 2 glyphs longer. This makes the terminal output jump
around if the terminal width is just right so that the shorter label makes
the status line 1 line long, and the longer label makes it 2 lines long.
This patch formats the selected status into a fixed-width field. The field
width is the maximum of the lengths of the two possible labels, to account for
differing translations and label lengths. This should make the label behavior
uniform across localizations.
There does not seem to be a test for crecord, so I verified the change manually
with a local build of 'hg'.
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Aug 2017 13:35:26 +0900] rev 33812
cext: move PyInt macros to charencode.c properly
Python3 build was broken at
e9996bd7203f.
Yuya Nishihara <yuya@tcha.org> [Mon, 14 Aug 2017 15:50:40 +0900] rev 33811
py3: change encoding.localstr to a subclass of bytes, not str
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Aug 2017 11:10:35 +0900] rev 33810
bundle2: relax the condition to update transaction.hookargs
This is just a micro optimization. If hookargs is empty, nothing should be
necessary.
Yuya Nishihara <yuya@tcha.org> [Sun, 13 Aug 2017 11:05:56 +0900] rev 33809
bundle2: raise ProgrammingError for invalid call of addhookargs()
It should be hard error. Also fixed the error message as s/hooks/hookargs/.
Alex Gaynor <agaynor@mozilla.com> [Fri, 14 Jul 2017 19:27:28 +0000] rev 33808
merge: removed sorting in casefolding detection, for a slight performance win
It was not required for the correctness of the algorithm.
Differential Revision: https://phab.mercurial-scm.org/D30
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 21:00:30 -0700] rev 33807
tests: verify that peer instances only expose interface members
Our abstract interfaces are more useful if we guarantee that
implementations conform to certain rules. Namely, we want to ensure
that objects implementing interfaces don't expose new public
attributes that aren't part of the interface. That way, as long as
consumers don't access "internal" attributes (those beginning with
"_") then (in theory) objects implementing interfaces can be swapped
out and everything will "just work."
We add a test that enforces our "no public attributes not part
of the abstract interface" rule.
We /could/ implement "interface compliance detection" at run-time.
However, that is littered with problems.
The obvious solutions are custom __new__ and __init__ methods.
These rely on derived types actually calling the parent's
implementation, which is no sure bet. Furthermore, __new__ and
__init__ will likely be called before instance-specific attributes
are assigned. In other words, they won't detect public attributes
set on self.__dict__. This means public attribute detection won't
be robust.
We could work around lack of robust self.__dict__ public attribute
detection by having our interfaces implement a custom __getattribute__,
__getattr__, and/or __setattr__. However, this incurs an undesirable
run-time penalty. And, subclasses could override our custom
method, bypassing the check.
The most robust solution is a non-runtime test. So that's what this
commit implements. We have a generic function for validating that an
object only has public attributes defined by abstract classes. Then,
we instantiate some peers and verify a newly constructed object
plays by the rules.
Differential Revision: https://phab.mercurial-scm.org/D339
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 20:58:28 -0700] rev 33806
wireproto: use new peer interface
The wirepeer class provides concrete implementations of peer interface
methods for calling wire protocol commands. It makes sense for this
class to inherit from the peer abstract base class. So we change
that.
Since httppeer and sshpeer have already been converted to the new
interface, peerrepository is no longer adding any value. So it has
been removed. httppeer and sshpeer have been updated to reflect the
loss of peerrepository and the inheritance of the abstract base
class in wirepeer.
The code changes in wirepeer are reordering of methods to group
by interface.
Some Python code in tests was updated to reflect changed APIs.
.. api::
peer.peerrepository has been removed. Use repository.peer abstract
base class to represent a peer repository.
Differential Revision: https://phab.mercurial-scm.org/D338
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 18:00:19 -0700] rev 33805
httppeer: use peer interface
This is similar to what we did to sshpeer. Quirks and all.
Differential Revision: https://phab.mercurial-scm.org/D337
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 17:59:48 -0700] rev 33804
sshpeer: use peer interface
We need the same @property conversion of ui like we did for localpeer.
We renamed _capabilities() to capabilities() to satisfy the new
naming requirement.
However, since we're inheriting from wireproto.wirepeer which inherits
from peer.peerrepository and provides its own code accessing
_capabilities(), we need to keep the old alias around. This wonkiness
will disappear once wirepeer is cleaned up in subsequent commits.
We also implement methods for basepeer that are identical to the
defaults in peer.peerrepository in preparation for the removal of
peerrepository.
Differential Revision: https://phab.mercurial-scm.org/D336
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:52:25 -0700] rev 33803
localrepo: use peer interfaces
We now have a formal abstract base class for peers. Let's
transition the peer classes in localrepo to it.
As part of the transition, we reorder methods so they are grouped
by interface and match the order they are defined in the interface.
We also had to change self.ui from an instance attribute to a
property to satisfy the @abstractproperty requirement.
As part of this change, we uncover the first "bug" as part of
enforcing interfaces: stream_out() wasn't implemented on localpeer!
This isn't technically a bug since the repo isn't advertising the
stream capability, so clients shouldn't be attempting to call it.
But I don't think there's a good reason why this is the case.
We implement a dummy method to satisfy the interface requriements.
We can make localpeer instances streamable as a future enhancement.
# no-check-commit
Differential Revision: https://phab.mercurial-scm.org/D335
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 06 Aug 2017 16:47:25 -0700] rev 33802
repository: implement generic capability methods on peer class
These methods are part of the peer interface, are generic, and can
be implemented in terms of other members of the peer interface. So we
implement them on the peer base class as a convenience.
The implementation is essentially copied from peer.py. The code
in peer.py will eventually be deleted.
Differential Revision: https://phab.mercurial-scm.org/D334
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 13 Aug 2017 11:04:42 -0700] rev 33801
repository: formalize wire protocol interface
There are a well-defined set of commands constituting the wire
protocol. Interaction with these and methods for calling them in
batches are exposed via methods on peer instances.
Let's formalize support for these features in abstract classes.
The command parts come from the existing wireproto.wirepeer class.
The batch methods come from peer.peerrepository.
Ample documentation has been added as part of defining the interfaces.
# no-check-commit
Differential Revision: https://phab.mercurial-scm.org/D333
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 13 Aug 2017 10:58:48 -0700] rev 33800
repository: formalize peer interface with abstract base class
There are various interfaces for interacting with repositories
and peers. They form a contract for how one should interact with
a repo or peer object.
The contracts today aren't very well-defined or enforced. There
have been several bugs over the years where peers or repo types
have forgotten to implement certain methods. In addition, the
inheritance of some classes is wonky. For example, localrepository
doesn't inherit from an interface and the god-object nature of
that class means the repository interface isn't well-defined. Other
repository types inherit from localrepository then stub out
methods that don't make sense (e.g. statichttprepository
re-defining locking methods to fail fast).
Not having well-defined interfaces makes implementing alternate
storage backends, wire protocol transports, and repository types
difficult because it isn't clear what exactly needs to be
implemented.
This patch starts the process of attempting to establish more
order to the type system around repositories and peers.
Our first patch starts with a problem space that already has a
partial solution: peers. The peer.peerrepository class already
somewhat defines a peer interface. But it is missing a few things
and the total interface isn't well-defined because it is combined
with wireproto.wirepeer.
Our newly-established basepeer class uses the abc module to
declare an abstract base class with the properties and methods that
a generic peer must implement.
We create a new class that inherits from it. This class will hold
our other future abstract base classes / interfaces so we can expose
a unified base class/interface.
We don't yet use the new interface because subsequent additions
will break existing code without some refactoring first.
A new module (repository.py) was created to hold the interfaces.
I could have put things in peer.py. However, I have plans to
eventually add interfaces to define repository and storage types.
These almost certainly require a new module. And I figured having
all the interfaces live in one module makes sense. So I created
repository.py to be that future home.
Differential Revision: https://phab.mercurial-scm.org/D332
Jun Wu <quark@fb.com> [Mon, 14 Aug 2017 22:28:59 -0700] rev 33799
util: make nogc effective for CPython
279cd80059d4 made `util.nogc` a no-op. It was to optimize PyPy. But it slows
down CPython if many objects (like 300k+) are created.
For example, running `hg log -r .` without extensions in `hg-committed` with
14k+ obsmarkers have the following times:
before | after
hg | chg | hg | chg
-----------------------------
1.262 | 0.860 | 1.077 | 0.619 (seconds, best of 20 runs)
Therefore let's re-enable nogc for CPython.
Differential Revision: https://phab.mercurial-scm.org/D402
Augie Fackler <augie@google.com> [Wed, 26 Jul 2017 23:47:54 -0400] rev 33798
scmutil: use util.shellquote instead of %r
Changes some output, but also resolves differences with Python 3.
Differential Revision: https://phab.mercurial-scm.org/D301
Boris Feld <boris.feld@octobus.net> [Mon, 14 Aug 2017 11:20:06 +0200] rev 33797
context: fix troubled deprecation
troubled has been renamed into isunstable but troubled was calling unstable
instead. Fix the mistake.
Differential Revision: https://phab.mercurial-scm.org/D384
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Aug 2017 22:26:48 -0400] rev 33796
test-pushvars: invoke shell script hook via `sh` for Windows
Invoking *.sh on Windows leads to the "what program should open this?" prompt,
which stalls the test and led to the recent series of exceptions on the Windows
test machine as the runner times out.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 14 Aug 2017 22:20:53 -0400] rev 33795
test-sparse: drop unnecessary globs
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 22:04:27 -0700] rev 33794
exchange: simplify unbundle locking using context managers
Differential Revision: https://phab.mercurial-scm.org/D393
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 22:42:10 -0700] rev 33793
util: add base class for transactional context managers
We have at least three types with a close() and a release() method
where the close() method is supposed to be called on success and the
release() method is supposed to be called last, whether successful or
not. Two of them (transaction and dirstateguard) already have
identical implementations of __enter__ and __exit__. Let's extract a
base class for this, so we reuse the code and so the third type
(transactionmanager) can also be used as a context manager.
Differential Revision: https://phab.mercurial-scm.org/D392
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 16:26:36 -0700] rev 33792
exchange: remove need for "locked" variable
The transactionmanager() constructor just assigned a few variables and
cannot fail, so it's safe to move it inside the earlier try/except.
Differential Revision: https://phab.mercurial-scm.org/D391
Martin von Zweigbergk <martinvonz@google.com> [Mon, 14 Aug 2017 16:14:14 -0700] rev 33791
exchange: drop now-unnecessary "local" from lock name variables
Since
fda0867cfe03 (exchange: drop support for lock-based unbundling
(BC), 2017-08-06), there is no more remote locking.
Differential Revision: https://phab.mercurial-scm.org/D390
Martin von Zweigbergk <martinvonz@google.com> [Fri, 28 Jul 2017 21:49:44 -0700] rev 33790
exchange: remove 'locallocked' member from pushop object
The variable has been used only within a single function since
94e2862dbcfb (push: elevate phase transaction to cover entire
operation, 2014-11-21), so there's no need to keep it on the pushop
object.
Differential Revision: https://phab.mercurial-scm.org/D389
Jun Wu <quark@fb.com> [Sat, 12 Aug 2017 21:01:06 -0700] rev 33789
rebase: change "result would have 3 parent" error message (BC)
The old error message "cannot use revision REV as base, result would have 3
parents" is confusing - why use REV as base? why add a new parent?.
This patch changes it to "cannot move parent", which seems better.
Differential Revision: https://phab.mercurial-scm.org/D342
Jun Wu <quark@fb.com> [Mon, 14 Aug 2017 07:02:38 -0700] rev 33788
drawdag: allow override file contents via comments
This makes drawdag more flexible, and allow us to create non-clean merges in
test cases.
Differential Revision: https://phab.mercurial-scm.org/D385
Jun Wu <quark@fb.com> [Fri, 04 Aug 2017 12:39:29 -0700] rev 33787
phabricator: add --amend option to phabsend
Previously `hg phabsend` was imitating `hg email` and won't mutate
changesets. That works fine with reviewer-push workflow, reviewers run
`phabread`, `import`.
However, it does not work well with author-push workflow. Namely, the author
needs to run extra commands to get the right commit message, and remove the
local tag after push.
This patch solves those issues by adding the `--amend` option, so local
changesets will have the right commit message, and tags become unnecessary.
Test Plan:
Given the following DAG:
o 17
o 16
| o 15
| @ 14
|/
o 13
o 12
Run `hg phabsend '(13::)-17' --amend`, check the new DAG looks like:
o 21
| o 20
| @ 19
|/
o 18
| o 17
| x 16
| x 13
|/
o 12
And commit messages are updated to contain the `Differential Revision` lines.
Use `phabread` to make sure Phabricator has the amended node recorded.
Also check `phabsend .` followed by a `phabsend . --amend`, the commit
message will be updated and the tag will be removed.
Differential Revision: https://phab.mercurial-scm.org/D122
Jun Wu <quark@fb.com> [Thu, 10 Aug 2017 21:30:31 -0700] rev 33786
rebase: rewrite core algorithm (
issue5578) (
issue5630)
"defineparents" is the core algorithm of rebase. The old code has too many
tech debts (like outdated comments, confusing assertions, etc) and is very
error-prone to be improved. This patch rewrites "defineparents" to make the
code easier to reason about, and solve a bunch of issues, including:
- Assertion error: no base found (demonstrated by D212,
issue5578)
- Asymmetric result (demonstrated by D211, "F with one parent")
- Wrong new parent (demonstrated by D262, "C':A'A'")
- "revlog index out of range" (demonstrated by D262,
issue5630)
- "nothing to merge" (demonstrated by D262)
As a side effect, merge base decision has been made more solid - rebase now
prints out explicitly what could go wrong when it cannot find a unique
suitable merge base.
.. fix:: Issue 5578, Issue 5630
Core rebase algorithm has been rewritten to be more robust.
Differential Revision: https://phab.mercurial-scm.org/D21
Jun Wu <quark@fb.com> [Sat, 12 Aug 2017 21:40:48 -0700] rev 33785
phabricator: remove an unnecessary writediffproperties call
This was introduced by D229. Thanks Yuya for finding it!
Differential Revision: https://phab.mercurial-scm.org/D366
Rishabh Madan <rishabhmadan96@gmail.com> [Sat, 12 Aug 2017 09:21:42 +0530] rev 33784
releasenotes: minor bug fix for index error while serializing
Differential Revision: https://phab.mercurial-scm.org/D356
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 15:31:54 +0200] rev 33783
label: rename log.trouble into log.instability
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D259
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 15:30:41 +0200] rev 33782
label: rename trouble.X into instability.X
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D258
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:32:50 +0200] rev 33781
label: rename changeset.troubled into changeset.unstable
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D257
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:16:54 +0200] rev 33780
test: add a test for stabilization related labels
Differential Revision: https://phab.mercurial-scm.org/D256
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:39:34 +0200] rev 33779
obsolete: rename bumped volatile set into phasedivergent volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D255
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:36:27 +0200] rev 33778
obsolete: rename divergent volatile set into contentdivergent volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D254
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 19:27:39 +0200] rev 33777
obsolete: rename unstable volatile set into orphan volatile set
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D253
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:08:39 +0200] rev 33776
revset: rename bumped into phasedivergent
Don't touch bumped volatile set name, only the revset name. The volatile set
name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D252
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 14:01:51 +0200] rev 33775
revset: remane divergent into contentdivergent
Don't touch divergent volatile set name, only the revset name. The volatile
set name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D251
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 13:48:39 +0200] rev 33774
revset: rename unstable into orphan
Don't touch unstable volatile set name, only the revset name. The volatile set
name will be updated in a later patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D250
Boris Feld <boris.feld@octobus.net> [Fri, 04 Aug 2017 18:41:16 +0200] rev 33773
test: update evolution config
evolution* config has been rewritten in stabilization* in the previous patch,
update tests file to use the new names.
Differential Revision: https://phab.mercurial-scm.org/D249
Boris Feld <boris.feld@octobus.net> [Thu, 03 Aug 2017 11:38:22 +0200] rev 33772
config: rename evolution config into stabilization
Use aliases for backward-compatibility. Though I'm not sure how to emit
compatibility warnings with aliases.
Test configuration are updated in the next patch.
The renaming is done according to
https://www.mercurial-scm.org/wiki/CEDVocabulary.
Differential Revision: https://phab.mercurial-scm.org/D248
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 03 Aug 2017 05:12:35 +0530] rev 33771
morestatus: move fb extension to core by plugging to `hg status --verbose`
morestatus extension in fbext use to show more context about the state of the
repo like the repository is in a unfinished merge state, or a rebase is going
on, or histedit is going on, listing the files which need to be resolved and
also suggesting ways to handle the situation.
This patch moves the extension directly to core by plugging it into the
--verbose flag of the status command. So now if you are in any unfinished state
and you do hg status -v, it will show you details and help related to the state.
The extension in fbext also shows context about unfinished update state
which is not ported to core as that plug in hooks to update command which need
to be tackled somewhat differently.
The following configuration will turn the behaviour on by default
[commands]
status.verbose = 1
You can also skip considering some states like bisect as follows:
[commands]
status.skipstates=bisect
This patch also adds test for the feature.
.. feature::
``hg status -v`` can now show unfinished state. For example, when in
an unfinished rebase state, ``hg status -v`` might show::
# The repository is in an unfinished *rebase* state.
# No unresolved merge conflicts.
# To continue: hg rebase --continue
# To abort: hg rebase --abort
Differential Revision: https://phab.mercurial-scm.org/D219
Boris Feld <boris.feld@octobus.net> [Wed, 09 Aug 2017 17:01:21 +0200] rev 33770
bundle2: fix transaction availability detection
Changeset
5fc4ddfbe626 introduce more complex logic around
'bundleoperation.gettransaction'. In that process it turns the old "attribute"
into a proper method which breaks the code that detects the "transaction
availability".
The change was visible in 'test-acl.t', fixing this reverts the test changes.
Differential Revision: https://phab.mercurial-scm.org/D303
Jun Wu <quark@fb.com> [Thu, 10 Aug 2017 09:37:50 -0700] rev 33769
fsmonitor: correct an error message
Without the change, the error looks like:
warning: Watchman unavailable: "watchman" executable not in PATH (%s),
while executing [Errno 2] No such file or directory
With the change, it now looks like:
warning: Watchman unavailable: "watchman" executable not in PATH
([Errno 2] No such file or directory)
Differential Revision: https://phab.mercurial-scm.org/D322
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 10 Aug 2017 20:55:28 -0700] rev 33768
sshpeer: make instance attributes and methods internal
Peer types are supposed to conform to a formal interface defined by
peer.peerrepository and wireproto.wirepeer. Every "public" attribute on
*peer types makes it harder to understand what attributes are part
of the interface and what are instance specific.
This commit converts a number of "public" instance attributes and
methods on sshpeer to internal so they can't be confused to be part of
the peer API.
The URL-related instance attributes were introduced in
876333a295ff
in 2005. AFAICT most of them aren't used and could potentially be
removed. But I kept them around anyway.
I also reorded some code to make things slightly easier to read.
.. api::
Rename attributes on sshpeer to reflect peer API
Differential Revision: https://phab.mercurial-scm.org/D331
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:35:20 -0700] rev 33767
peer: remove non iterating batcher (API)
The last use of this API was removed in
b6e71f8af5b8 in 2016. While
not formally deprecated, as of the last commit the code is no longer
explicitly tested. I think the new API has existed long enough for
people to transition to it.
I also have plans to more formalize the peer API and removing batch()
makes that work easier.
I'm not convinced the current client-side API around batching is
great. But it's the best we have at the moment.
.. api:: remove peer.batch()
Replace with peer.iterbatch().
Differential Revision: https://phab.mercurial-scm.org/D320
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 23:29:30 -0700] rev 33766
wireproto: overhaul iterating batcher code (API)
The remote batching code is difficult to read. Let's improve it.
As part of the refactor, the future returned by method calls on
batchiter() instances is now populated. However, you still need to
consume the results() generator for the future to be set. But at
least now we can stuff the future somewhere and not have to worry
about aligning method call order with result order since you can
use a future to hold the result.
Also as part of the change, we now verify that @batchable generators
yield exactly 2 values. In other words, we enforce their API.
The non-iter batcher has been unused since
b6e71f8af5b8. And to my
surprise we had no explicit unit test coverage of it! test-batching.py
has been overhauled to use the iterating batcher.
Since the iterating batcher doesn't allow non-batchable method
calls nor local calls, tests have been updated to reflect reality.
The iterating batcher has been used for multiple releases apparently
without major issue. So this shouldn't cause alarm.
.. api::
@peer.batchable functions must now yield exactly 2 values
Differential Revision: https://phab.mercurial-scm.org/D319
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 22:52:05 -0700] rev 33765
wireproto: remove support for local results in @batchable (API)
@peer.batchable decorated generator functions have two forms:
yield value, None
and
yield args, future
yield value
These forms have been present since the decorator was introduced.
There are currently no in-repo consumers of the first form. So this
commit removes support for it.
Note that remoteiterbatcher.submit() asserts the 2nd form. And
b6e71f8af5b8 removed the last user of remotebatcher, forcing everyone
to remoteiterbatcher. So anything relying on this in the wild would
have been broken since
b6e71f8af5b8.
.. api::
@peer.batchable can no longer emit local values
Differential Revision: https://phab.mercurial-scm.org/D318
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 21:51:45 -0700] rev 33764
wireproto: properly implement batchable checking
remoteiterbatcher (unlike remotebatcher) only supports batchable
commands. This claim can be validated by comparing their
implementations of submit() and noting how remoteiterbatcher assumes
the invoked method has a "batchable" attribute, which is set by
@peer.batchable.
remoteiterbatcher has a custom __getitem__ that was trying to
validate that only batchable methods are called. However, it was only
validating that the called method exists, not that it is batchable.
This wasn't a big deal since remoteiterbatcher.submit() would raise
an AttributeError attempting to `mtd.batchable(...)`.
Let's fix the check and convert it to ProgrammingError, which may
not have been around when this was originally implemented.
Differential Revision: https://phab.mercurial-scm.org/D317
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 09 Aug 2017 21:04:03 -0700] rev 33763
largefiles: remove remotestore.batch()
This method was added in
9e1616307c4c. AFAICT it didn't do anything at
inception. If it did, there was no test coverage for it because
changing it to raise doesn't fail any tests at that revision.
b6e71f8af5b8 later refactored all remote.batch() calls to
remote.iterbatch(). So if this was somehow used, it isn't called
any more because there are no calls to .batch() remaining in the
repo.
I suspect the original patch author got confused by the distinction
between the peer/remote interface and the largefiles store. The lf
store is a gateway to a peer instance. It exposes additional
lf-specific methods to execute against a peer. However, it is not
a peer and doesn't need to implement batch() because peer itself
does that.
Differential Revision: https://phab.mercurial-scm.org/D316
André Klitzing <aklitzing@gmail.com> [Fri, 11 Aug 2017 15:20:41 +0200] rev 33762
histedit: check first changeset for verb "roll" or "fold" (
issue5498)
If someone changes "pick" to "roll" or "fold" for the first
changeset in a histedit rule Mercurial could remove a wrong
changeset if the phase is non-public.
roll or fold for the first changeset should be invalid.
Yuya Nishihara <yuya@tcha.org> [Mon, 31 Jul 2017 23:13:47 +0900] rev 33761
encoding: drop circular import by proxying through '<policy>.charencode'
I decided not to split charencode.c to new C extension module because it
would duplicate binary codes unnecessarily.
Yuya Nishihara <yuya@tcha.org> [Mon, 31 Jul 2017 23:40:36 +0900] rev 33760
policy: reroute proxy modules internally
This allows us to split encoding functions from pure.parsers without doing
that for cext.parsers. See the next patch for why.