Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34037
merge: move some of the logic in batchget() to workingfilectx
We will use this logic in two places with in-memory merge.
Differential Revision: https://phab.mercurial-scm.org/D444
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34036
filemerge: add _restorebackup
Differential Revision: https://phab.mercurial-scm.org/D404
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34035
filemerge: reduce creation of tempfiles until needed
This restricts the creation of temporary files to just `_xmerge`, when we call
an external tool.
Differential Revision: https://phab.mercurial-scm.org/D403
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34034
filemerge: add `_workingpath`
This reduces any reliance on `a`.
Differential Revision: https://phab.mercurial-scm.org/D401
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34033
filemerge: move a util copy call to filectx.write
This way a future in-memory-merge context can intercept them.
Differential Revision: https://phab.mercurial-scm.org/D400
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34032
filemerge: eliminate most uses of tempfiles
Emphasize that they're unused so we can more easily remove them later.
Differential Revision: https://phab.mercurial-scm.org/D399
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:05:19 -0700] rev 34031
filemerge: extract _maketemp and _makebackup
These functions will be modified by in-memory merge, so let's extract them first and add some comments.
This also shortens `_filemerge` a bit.
Differential Revision: https://phab.mercurial-scm.org/D388
Yuya Nishihara <yuya@tcha.org> [Thu, 31 Aug 2017 21:56:40 +0900] rev 34030
encoding: check overflow while calculating size of JSON escape buffer
The minimum input size to exploit is ~682MB (= INT_MAX / len('\\u0000') * 2)
on 32bit system, which isn't easy to achieve using Python str in 2GB process
address space, but probably doable.
Michael Bolin <mbolin@fb.com> [Wed, 30 Aug 2017 20:25:56 +0000] rev 34029
editor: use an unambiguous path suffix for editor files
Changes the API of `ui.edit()` to take an optional `action` argument,
which is used when constructing the suffix of the temp file.
Previously, it was possible to set the suffix by specifying a `suffix` to the
optional `extra` dict that was passed to `ui.edit()`, but the goal is to
drop support for `extra.suffix` and make `action` a required argument.
To this end, `ui.edit()` now yields a `develwarn()` if `action` is not set
or if `extra.suffix` is set.
I updated all calls to `ui.edit()` I could find in `hg-crew` to specify the
appropriate `action`. This means that when creating a commit, instead
of the path to the editor file being something like:
`/tmp/hg-editor-XXXXXX.txt`
it is now something like:
`/tmp/hg-editor-XXXXXX.commit.hg.txt`
Some editors (such as Atom) make it possible to statically define a [TextMate]
grammar for files with a particular suffix. For example, because Git reliably
uses `.git/COMMIT_EDITMSG` and `.git/MERGE_MSG` as the paths for commit-type
messages, it is trivial to define a grammar that is applied when files of
either name are opened in Atom:
https://github.com/atom/language-git/blob/v0.19.1/grammars/git%20commit%20message.cson#L4-L5
Because Hg historically used a generic `.txt` suffix, it was much harder to
disambiguate whether a file was an arbitrary text file as opposed to one
created for the specific purpose of authoring an Hg commit message.
This also makes it easier to add special support for `histedit`, as it has its own
suffix that is distinct from a commit:
`/tmp/hg-histedit-XXXXXX.histedit.hg.txt`
Test Plan:
Added an integration test: `test-editor-filename.t`.
Manually tested: ran `hg ci --amend` for this change and saw that it
used `/tmp/hg-editor-ZZjcz0.commit.hg.txt` as the path instead of
`/tmp/hg-editor-ZZjcz0.txt` as the path.
Verified `make tests` passes.
Differential Revision: https://phab.mercurial-scm.org/D464
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Aug 2017 09:21:31 -0700] rev 34028
revlog: move check for wdir from changelog to revlog
Yuya said he preferred this (to keep them in one place, I think).
Differential Revision: https://phab.mercurial-scm.org/D569
Matt Harbison <matt_harbison@yahoo.com> [Tue, 29 Aug 2017 16:38:10 -0400] rev 34027
debugssl: allow a URL to be specified without a local repository
This was the original intent, but I bungled the logic. Otherwise if there is a
certificate chain issue, the repository can't be cloned in order for there to be
a repo object. I think I missed this case because I was inside of a Mercurial
clone as I was originally developing and testing this.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 21:21:43 -0400] rev 34026
revlog: use pycompat.bytestr() to reliably have a %s-able value
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 23:11:35 -0400] rev 34025
debugcommands: stabilize output of debugbundle by having a custom repr
We handle all dict-like things the same, and don't worry about it
actually being a repr.
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:25:08 -0400] rev 34024
python3: whitelist another 5 passing tests found with the ratchet script
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:06:58 -0400] rev 34023
python3: replace sorted(<dict>.iterkeys()) with sorted(<dict>)
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:03:07 -0400] rev 34022
python3: wrap all uses of <exception>.strerror with strtolocal
Our string literals are bytes, and we mostly want to %-format a
strerror into a one of those literals, so this fixes a ton of issues.
Jun Wu <quark@fb.com> [Wed, 30 Aug 2017 14:04:55 -0700] rev 34021
pager: do not start pager if `ui` has been `pushbuffer`-ed
The `pushbuffer`, `popbuffer` APIs are intended to capture internal output.
They will prevent `ui.write` from writing to the actual `ui.fout`. So a
pager won't receive the output and do the right thing. In general, it does
not make sense to start a pager if ui is in the "pushbuffer" mode.
Differential Revision: https://phab.mercurial-scm.org/D574
Jun Wu <quark@fb.com> [Wed, 30 Aug 2017 16:05:12 -0700] rev 34020
revset: do not flip "and" arguments when optimizing
Rewrite `flipand(y, x)` to `andsmally(x, y)` so the AST order is unchanged,
which could be more friendly to developers.
Differential Revision: https://phab.mercurial-scm.org/D579
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:51:28 +0900] rev 34019
revset: make match function follow given subset if specified (API)
This should be sensible default since mfunc(subset) is roughly equivalent
to 'subset & mfunc'. The order argument is still there so we can specify
'anyorder' if the order doesn't really matter.
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:41:36 +0900] rev 34018
revset: move order argument to run-time match function
We no longer need the order flag to build a parsed tree.
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 23:53:30 +0900] rev 34017
revset: fix example describing how ordering is determined
It was 'X & !Y' before.
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:32:47 +0900] rev 34016
revset: move order constants from revsetlang
Thanks to the recent refactor, the ordering rule is fully processed at
runtime.
Denis Laxalde <denis@laxalde.org> [Tue, 29 Aug 2017 11:25:22 +0200] rev 34015
tag: use filtered repo when creating new tags (
issue5539)
When pruning a changeset that added a tag and then adding another tag, the
"pruned" tag gets restored. This is because the tag creation step (tags._tag()
call in tags.tag()) is currently done on the unfiltered repo. This behavior
has been there from
7977d35df13b which backs out
b08af8f0ac01 with no clear
reason but caution on unthought situations at that time. In this changeset, we
pass the filtered repo to tags._tag(), preventing "pruned" tags to reappear.
This somehow restores
b08af8f0ac01, though now we arguably have a valid use
case for.
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Aug 2017 16:46:05 -0700] rev 34014
extensions: add wrappedfunction() context manager
Several extensions exist that temporarily want to wrap a function (at
least narrowhg, any many of the extensions in hg-experimental). That's
why we have the unwrapfunction() that was introduced in
19578bb84731
(extensions: add unwrapfunction to undo wrapfunction, 2016-08-10).
This patch adds a simple wrappedfunction() that returns a context
manager.
Differential Revision: https://phab.mercurial-scm.org/D472
David Soria Parra <davidsp@fb.com> [Tue, 29 Aug 2017 18:20:50 -0700] rev 34013
mdiff: add a --ignore-space-at-eol option
Add an option that only ignores whitespaces at EOL. The name of the option is
the same as Git.
.. feature::
Added `--ignore-space-at-eol` diff option to ignore whitespace differences
at line endings.
Differential Revision: https://phab.mercurial-scm.org/D422
Jun Wu <quark@fb.com> [Fri, 25 Aug 2017 11:20:34 -0700] rev 34012
revset: improve documentation about ordering handling
The old documentation is a bit confusing. Namely, it's unclear whether
`define` means "I should ALWAYS define a new order", or "I should SOMETIMES
define a new order", and if it's the latter, what's the difference between
`define` and `any`?
This patch clarifies that and adds more examples.
Differential Revision: https://phab.mercurial-scm.org/D523
Jun Wu <quark@fb.com> [Sun, 20 Aug 2017 10:55:11 -0700] rev 34011
revset: remove order information from tree (API)
Keeping `order` in tree makes AST operation harder. And there could be
invalid cases if trees could be generated and compounded freely, like:
SetA(order=define) & SetB(order=define)
^^^^^^ couldn't be satisfied
This patch changes the code to calculate order on the fly, during tree
traversal. Optimization of reordering `and` arguments is preserved by
introducing a new internal operation `flipand`.
.. api::
revset.stringset() now takes 'order' as the last argument.
Differential Revision: https://phab.mercurial-scm.org/D451
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 23:44:47 -0700] rev 34010
revset: drop optimization about reordering "or" set elements
The reordering optimization is more important for "and" than "or", given the
implementation details about "addset" and "filteredset" - reordering "or"
may help "__contains__" test but not iteration, reordering "and" could help
both. We are going to simplify the tree to remove ordering information.
Removing "or" reordering optimization would make things simpler.
This effectively reverts
c63cb2d10d6d. It tracks back to the "orset"
function added by the initial commit of revset (
c9ce8ecd6).
In the future, we might consider optimization at runtime (ex. do reordering
and rewrites inside "orset").
Differential Revision: https://phab.mercurial-scm.org/D561
Jun Wu <quark@fb.com> [Tue, 29 Aug 2017 17:51:54 -0700] rev 34009
rebase: use _ctxdesc in one more place
This simplifies the code.
Differential Revision: https://phab.mercurial-scm.org/D566
Jun Wu <quark@fb.com> [Sun, 27 Aug 2017 02:47:47 -0700] rev 34008
rebase: move working parent and bookmark for obsoleted revs (BC)
Previously, obsoleted revs with successors in destination are completely
ignored. That caused some inconvenience when working copy is obsoleted. Most
commands avoid working copy being obsoleted, but `hg pull` is an exception.
This patch makes rebase able to move bookmarks or working parent for those
obsoleted revs. It does so by keeping the obsoleted revs in `state` and
marking them as "skipped, rebased to desired destination" during run-time.
This reverts part of the behavior change of
3b7cb3d17137 and D24.
Differential Revision: https://phab.mercurial-scm.org/D527
Jun Wu <quark@fb.com> [Tue, 29 Aug 2017 17:49:13 -0700] rev 34007
rebase: remove an unnecessary adjustdest in clearrebased
`rev` being "skipped" could currently be caused by moving `rev` does not
create a new commit. In this case, `state[rev]` is already changed to `p1`,
and is a sane destination for bookmark or working parent movement. Therefore
an additional destination adjustment is unnecessary.
Differential Revision: https://phab.mercurial-scm.org/D565
Jun Wu <quark@fb.com> [Mon, 21 Aug 2017 20:22:07 -0700] rev 34006
rebase: sort destmap topologically
Previously rebase source and destination could not overlap. But with the
multi-destination support, source and destination could reasonably partially
overlap. That requires another topological sort on `{sourcerev: destrev}`
graph (destmap). This patch implements that.
If a revision's destination is itself, the error message gets changed from
"source is ancestor of destination" to "source and destination form a
cycle". Not marking as BC since automation should depend on exit code, not
error message.
Differential Revision: https://phab.mercurial-scm.org/D470
Jun Wu <quark@fb.com> [Tue, 29 Aug 2017 17:27:37 -0700] rev 34005
rebase: initial support for multiple destinations
This patch defines `SRC` (a single source revision) and `ALLSRC` (all source
revisions) to be valid names in `--dest` revset if `--src` or `--rev` is
used. So destination could be defined differently according to source
revisions. The names are capitalized to make it clear they are "dynamically
defined", distinguishable from normal revsets (Thanks Augie for the
suggestion).
This is useful, for example, `-r 'orphan()' -d 'calc-dest(SRC)'` to solve
instability, which seems to be a highly wanted feature.
The feature is not completed, namely if `-d` overlaps with `-r`, things
could go wrong. A later patch will handle that case.
The feature is also gated by `experimental.rebase.multidest` config option
which is default off.
Differential Revision: https://phab.mercurial-scm.org/D469
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 00:32:19 -0700] rev 34004
rebase: change internal format to support destination map
A later patch will add multiple destination support. This patch changes
internal state and the rebase state file format to support that. But the
external interface still only supports single destination.
A test was added to make sure rebase still supports legacy state file.
The new state file is incompatible with old clients. We had done similar
state file format change before: 5eac7ab, 92409f8, and 72412af. The state
file is transient, so the impact of incompatibility is limited. Besides,
the old client won't support multiple destinations anyway so it does not
really make sense to make the file format compatible with them.
Differential Revision: https://phab.mercurial-scm.org/D348
Jun Wu <quark@fb.com> [Fri, 11 Aug 2017 00:31:52 -0700] rev 34003
rebase: rewrite _computeobsoletenotrebased
The old code stores successors of all related nodes together, which works
fine if destination is unique. A future patch would make destination
non-unique so let's change the implementation to test successors for
rebaseset separately.
Differential Revision: https://phab.mercurial-scm.org/D347
Michael Bolin <mbolin@fb.com> [Tue, 22 Aug 2017 00:38:38 +0000] rev 34002
util: use ~ as a suffix for a temp file in the same directory as a source file
Tools like Buck have patterns to ignore the creation of files (in the working
copy) that match certain patterns:
https://github.com/facebook/buck/blob/
39278a4f0701c5239eae148968dc1ed4cc8661f7/src/com/facebook/buck/cli/Main.java#L259-L299
When Buck sees a new source file (as reported by Watchman), it has to invalidate
a number of caches associated with the directory that contains the file.
Using a standard suffix, such as `~`, would make it easier for Buck and others
to filter out these types of file creation events.
The other uses of `tempfile.mkstemp()` in Hg do not appear to be problematic
because they (generally speaking) do not specify the `dir` parameter, so the
new file is created in the system-appropriate temp directory, which is outside
the working copy.
Test Plan:
`make tests`
Differential Revision: https://phab.mercurial-scm.org/D468
Martin von Zweigbergk <martinvonz@google.com> [Mon, 28 Aug 2017 14:47:18 -0700] rev 34001
morestatus: simplify check for unresolved merge conflicts
Differential Revision: https://phab.mercurial-scm.org/D546
Martin von Zweigbergk <martinvonz@google.com> [Mon, 28 Aug 2017 15:06:34 -0700] rev 34000
tests: rename test-terse-status.t to test-status-terse.t
When looking for status tests, most people would probably look for
"test-status*", so it would be nice if they could find it there. This
also let's them run (most) status tests with "run-tests.py
test-status*".
Differential Revision: https://phab.mercurial-scm.org/D547
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