Sushil khanchi <sushilkhanchi97@gmail.com> [Wed, 27 Jun 2018 12:24:21 +0530] rev 38485
rebase: refactor dryrun implementation
This patch refactor dry-run code to make it easy to add additional
functionality in dryrun. Otherwise we had to add every functionality
through _origrebase() which does not seem a good implementation.
Differential Revision: https://phab.mercurial-scm.org/D3849
Matt Harbison <matt_harbison@yahoo.com> [Sun, 02 Jul 2017 00:32:09 -0400] rev 38484
hooks: allow Unix style environment variables on external Windows hooks
This will help making common hooks between Windows and non-Windows platforms.
Having to build the shellenviron dict here and in procutil.system() is a bit
unfortunate, but the only other option is to fix up the command inside
procutil.system(). It seems more important that the note about the hook being
run reflects what is actually run.
The patch from last summer added the hooks on the command line, but it looks
like HG_ARGS has since learned about --config args, and the output was just
confusing. Therefore, it's now loaded from a file in the histedit test for
clarity.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 24 Jun 2018 01:13:09 -0400] rev 38483
windows: add a method to convert Unix style command lines to Windows style
This started as a copy/paste of `os.path.expandvars()`, but limited to a given
dictionary of variables, converting `foo = foo + bar` to `foo += bar`, and
adding 'b' string prefixes. Then code was added to make sure that a value being
substituted in wouldn't itself be expanded by cmd.exe. But that left
inconsistent results between `$var1` and `%var1%` when its value was '%foo%'-
since neither were touched, `$var1` wouldn't expand but `%var1%` would. So
instead, this just converts the Unix style to Windows style (if the variable
exists, because Windows will leave `%missing%` as-is), and lets cmd.exe do its
thing.
I then dropped the %% -> % conversion (because Windows doesn't do this), and
added the ability to escape the '$' with '\'. The escape character is dropped,
for consistency with shell handling.
After everything seemed stable and working, running the whole test suite flagged
a problem near the end of test-bookmarks.t:1069. The problem is cmd.exe won't
pass empty variables to its child, so defined but empty variables are now
skipped. I can't think of anything better, and it seems like a pre-existing
violation of the documentation, which calls out that HG_OLDNODE is empty on
bookmark creation.
Future additions could potentially be replacing strong quotes with double quotes
(cmd.exe doesn't know what to do with the former), escaping a double quote, and
some tilde expansion via os.path.expanduser(). I've got some doubts about
replacing the strong quotes in case sh.exe is run, but it seems like the right
thing to do the vast majority of the time. The original form of this was
discussed about a year ago[1].
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-July/100735.html
Anton Shestakov <av6@dwimlabs.net> [Thu, 28 Jun 2018 10:50:53 +0800] rev 38482
hgweb: add archive entries to graph page
Changelog page has them, so it makes sense to add them to graph page too.
Anton Shestakov <av6@dwimlabs.net> [Thu, 28 Jun 2018 07:41:08 +0800] rev 38481
hgweb: add z-index for search field tooltip
On graph page, search field tooltip sometimes goes down to the graph area,
where it used to be covered by foreground element of graph entries (.fg)
because they have z-index: 10.
To prevent the tooltip from being covered, z-index: 15 is enough.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 Jun 2018 07:19:30 -0700] rev 38480
tests: pass "rev" argument to commands.update() as string
commands.update() normally gets its "rev" argument as a string, but
test-basic.t was passing an integer. That happened to work, but we
shouldn't rely on it.
Differential Revision: https://phab.mercurial-scm.org/D3851
Yuya Nishihara <yuya@tcha.org> [Wed, 27 Jun 2018 23:39:41 +0900] rev 38479
revset: fix heads() order to always follow the input set (BC)
An argument expression should never affect the order of the result set.
That's the rule of the revset predicates.
Yuya Nishihara <yuya@tcha.org> [Wed, 27 Jun 2018 23:33:57 +0900] rev 38478
test-revset: show that order of heads() can be wrong
Augie Fackler <augie@google.com> [Wed, 27 Jun 2018 10:21:07 -0400] rev 38477
stringutil: update list of re-special characters to include &~
I missed this because I was looking at the change that refactored
re.escape, and these characters were added in
https://github.com/python/cpython/commit/
05cb728d68a278d11466f9a6c8258d914135c96c.
Differential Revision: https://phab.mercurial-scm.org/D3850
Augie Fackler <augie@google.com> [Tue, 26 Jun 2018 11:38:58 -0400] rev 38476
tests: fix up some lax escaping in test-template-basic.t
These misfired escapes turn into hard errors in Python 3.7, and I'd
really rather we not work around it. We should *probably* try and find
a way to proactively warn users about invalid escape sequences.
There's one more failure of this type in this file on Python 3.7, but
I can't figure out the issue. It'll need to be corrected in a
follow-up.
Differential Revision: https://phab.mercurial-scm.org/D3843
Augie Fackler <augie@google.com> [Tue, 26 Jun 2018 10:36:23 -0400] rev 38475
cleanup: migrate from re.escape to stringutil.reescape
This has consistent behavior on Python 2.7, 3.6, and 3.7 and has the
benefit of probably being a little faster. Test output changes are
largely because / used to be pointlessly escaped.
Differential Revision: https://phab.mercurial-scm.org/D3842
Augie Fackler <augie@google.com> [Tue, 26 Jun 2018 10:33:52 -0400] rev 38474
stringutil: add a new function to do minimal regex escaping
Per https://bugs.python.org/
issue29995, re.escape() used to
over-escape regular expression strings, but in Python 3.7 that's been
fixed, which also improved the performance of re.escape(). Since it's
both an output change for us *and* a perfomance win, let's just
effectively backport the new behavior to hg on all Python versions.
Differential Revision: https://phab.mercurial-scm.org/D3841
Sushil khanchi <sushilkhanchi97@gmail.com> [Tue, 26 Jun 2018 16:14:02 +0530] rev 38473
graft: add no-commit mode (
issue5631)
This patch adds a new flag --no-commit in graft command. This feature
grafts the changes but do not create commits for those changes, grafted
changes will be added in the working directory. Also added tests to reflect
the expected behavior.
Differential Revision: https://phab.mercurial-scm.org/D2409
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 26 Jun 2018 02:05:11 +0530] rev 38472
patchbomb: use email.mime.base instead of email.MIMEBase
The later was removed on Python 3.
On python 2:
>>> email.MIMEBase.MIMEBase is email.mime.base.MIMEBase
True
Differential Revision: https://phab.mercurial-scm.org/D3836
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 26 Jun 2018 02:04:17 +0530] rev 38471
patchbomb: use email.mime.multipart instead of email.MIMEMultipart
The later was removed in Python 3.
On python 2:
>>> email.MIMEMultipart.MIMEMultipart is email.mime.multipart.MIMEMultipart
True
Differential Revision: https://phab.mercurial-scm.org/D3835
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 26 Jun 2018 01:08:47 +0530] rev 38470
py3: add b'' prefixes in tests/test-bundle2-pushback.t
This makes the test run on Python 3.
# skip-blame because just b'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D3834
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 26 Jun 2018 00:37:02 +0530] rev 38469
py3: make tests/test-diff-antipatience.t work with python 3
On python3, if we do list(b'abcd'), we get [97, 98, 99, 100]. So this patch does
the list() operation on unicodes and then convert things to bytes.
This also adds `and None` to suppress return values of .write() calls.
Differential Revision: https://phab.mercurial-scm.org/D3833
Martin von Zweigbergk <martinvonz@google.com> [Mon, 25 Jun 2018 11:04:17 -0700] rev 38468
terse: pass "clean" and "unknown" booleans by name for clarity
Differential Revision: https://phab.mercurial-scm.org/D3838
Martin von Zweigbergk <martinvonz@google.com> [Mon, 25 Jun 2018 11:01:11 -0700] rev 38467
terse: add tests of running from subdirectory
I also included comments explaining what I think the output should be
(discussion started on D3628).
Differential Revision: https://phab.mercurial-scm.org/D3837
Yuya Nishihara <yuya@tcha.org> [Sat, 23 Jun 2018 19:23:53 +0900] rev 38466
convert: don't pass --no-files to "darcs show repo" command
The test fails with darcs 2.14.0 because --no-files is no longer supported.
It was removed at the patch
97973a52bf496657558412562d6fad2ee651b1e0, which
says "show repo: removed --files option, removed manual flags parsing."
As far as I can tell, --no-files was specified just for optimization, so old
darcs should work without it.
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 00:15:44 +0200] rev 38465
shelve: stop testing missing rebase state file
We no longer use the file. Neither during rebase not during continue.
Differential Revision: https://phab.mercurial-scm.org/D3691
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 00:12:35 +0200] rev 38464
shelve: actually test corrupted shelve state
The test was previous moving the corrupted shelve state file as an histedit
state file.
Differential Revision: https://phab.mercurial-scm.org/D3690
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 00:13:48 +0200] rev 38463
shelve: directly handle `--continue`
Shelve is currently sub-contracting some of its work to the rebase extension.
In order to make shelve more independent and flexible we would like shelve to
handle the parent alignment directly.
This changeset takes on the next step, handling the abort process. Same as for
--abort. It turns out we have all the necessary bits in the `shelvestate`
file. So we do not need anything from the interrupted rebase.
Differential Revision: https://phab.mercurial-scm.org/D3689
Boris Feld <boris.feld@octobus.net> [Mon, 28 May 2018 18:15:21 +0200] rev 38462
shelve: directly handle the abort process
Shelve is currently sub-contracting some of its work to the rebase extension.
In order to make shelve more independent and flexible we would like shelve to
handle the parent alignment directly.
This change starts with the simplest bits, handling the abort process. It
turns out we have all the necessary bits in the `shelvestate` file. So we do
not need anything from the interrupted rebase.
As a nice side effect, a test about missing `shelverebasestate` state file now
behave better.
Differential Revision: https://phab.mercurial-scm.org/D3688
Boris Feld <boris.feld@octobus.net> [Mon, 28 May 2018 20:51:20 +0200] rev 38461
shelve: check the actual shelvestate in morestatus
The rebasestate is a lower level implementation details that we are trying to
remove.
Differential Revision: https://phab.mercurial-scm.org/D3687
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 May 2018 18:44:03 -0700] rev 38460
packaging: dynamically define make targets
We currently have make boilerplate for each instance of a distro's
release. This is redundant, annoying to maintain, and prone to errors.
This commit defines variables holding available releases for
various distros. We then iterate through the list and dynamically
define make targets.
Differential Revision: https://phab.mercurial-scm.org/D3761
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 May 2018 14:41:48 -0700] rev 38459
packaging: don't write files for templatized Dockerfiles
Now that Docker image building is implemented in Python and we
can perform template substitution in memory, we don't need to
write out produced Dockerfiles to disk.
Differential Revision: https://phab.mercurial-scm.org/D3760
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 May 2018 17:03:47 -0700] rev 38458
packaging: replace dockerlib.sh with a Python script
I want to do some more advanced things with Docker in upcoming
commits. Trying to do that with shell scripts will be a bit too
painful for my liking. Implementing things in Python will be
vastly simpler in the long run.
This commit essentially ports dockerlib.sh to a Python script.
dockerdeb and dockerrpm have been ported to use the new hg-docker
script.
hg-docker requires Python 3. I've only tested on Python 3.5.
Unlike the local packaging scripts which may need to run on old
distros, the Docker packaging scripts don't have these constraints.
So I think it is acceptable to require Python 3.5.
As part of the transition, the Docker image tags changed slightly.
I don't think that's a big deal: the Docker image names are
effectively arbitrary and are a means to an end to achieve
running commands in Docker containers.
The code for resolving the Dockerfile content allows substituting
values passed as arguments. This will be used in a subsequent commit.
Differential Revision: https://phab.mercurial-scm.org/D3759
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 May 2018 15:51:37 -0700] rev 38457
packaging: consistently create build user in Dockerfiles
Previously, dockerlib.sh appended some commands to create a
"build" user in each Docker image. The resulting Docker images
could be inconsistent depending on the execution environment
and base image.
With this change, we explicitly create our custom user and
group as the first action in each Dockerfile. The user always
has user:group 1000:1000 and all built images are consistent.
We also create a home directory for the user under /build.
This directory is currently ignored.
As part of this, we stop setting the DBUILDUSER variable in
dockerlib.sh and instead set it in the respective scripts that
call it. This is in preparation for further refactoring of
dockerlib.sh.
Differential Revision: https://phab.mercurial-scm.org/D3758
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jun 2018 00:50:48 +0530] rev 38456
scmutil: move construction of instability count message to separate fn
When the commad we are running, introduces new instabilities, we show a message
like `5 new orphan changesets`, `2 new content-divergent changesets`, `1 new
phase-divergent changesets` etc which is very nice.
Now taking a step ahead, we want users to show how to fix them too. Something
like:
`5 new orphan changesets (run 'hg evolve' to resolve/stabilize them)`
`2 new content-divergent changesets (run 'hg evolve --content-divergent' to
resolve them)`
and maybe telling user a way to understand more about those new instabilities
like `hg evolve --list` or `hg log -r 'orphan()'` something like that.
The idea came from
issue5855 which I want to fix because fixing that will result
in a nice UI.
Taking the construction logic out will allow extensions like evolve (maybe
rebase too) to wrap that and add information about how to resolve and how to
understand the instability more.
Differential Revision: https://phab.mercurial-scm.org/D3734
Sune Foldager <cryo@cyanite.org> [Mon, 25 Jun 2018 16:36:14 +0200] rev 38455
procutil: use unbuffered stdout on Windows
Windows doesn't support line buffering, treating it as fully buffered. This
causes output of slow commands to stutter. We use unbuffered instead.
Sune Foldager <cryo@cyanite.org> [Mon, 25 Jun 2018 16:36:14 +0200] rev 38454
procutil: use unbuffered stdout on Windows
Windows doesn't support line buffering, treating it as fully buffered. This
causes output of slow commands to stutter. We use unbuffered instead.
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 25 May 2018 18:16:38 +0530] rev 38453
graft: introduce --abort flag to abort interrupted graft
This patch introduces a new --abort flag to `hg graft` command which aborts an
interrupted graft and rollbacks to the state before graft.
The behavior when some of grafted changeset get's published while interrupted
graft or we have new descendants on grafted changesets is same as that of rebase
which is warn the user, don't strip and abort the abort the graft.
Tests are added for the new flag.
.. feature::
`hg graft` now has a `--abort` flag which aborts the interrupted graft and
rollbacks to state before the graft.
Differential Revision: https://phab.mercurial-scm.org/D3754
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jun 2018 02:46:34 +0530] rev 38452
graft: move `if continue` to elif and add new line
This will make upcoming patch where we introduce a new elif for the abort case
more readable. Also added a new line before the if-else starts.
Differential Revision: https://phab.mercurial-scm.org/D3752
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 15 Jun 2018 02:34:27 +0530] rev 38451
graft: start storing new nodes formed in graftstate
This patch starts storing the new nodes formed during the ongoing graft
operation in the graftstate. We need the list of new nodes formed while
implmenting `graft --abort` which will strip out the new nodes.
Differential Revision: https://phab.mercurial-scm.org/D3751
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 23:22:51 +0900] rev 38450
show: use filter() function to strip "tip" tag
Before, an empty tag "" was inserted in place of "tip", resulting in double
spaces.
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 23:10:14 +0900] rev 38449
templater: extend filter() to accept template expression for emptiness test
This utilizes the pass-by-name nature of template arguments.
Yuya Nishihara <yuya@tcha.org> [Thu, 14 Jun 2018 22:33:26 +0900] rev 38448
templater: introduce filter() function to remove empty items from list
The primary use case is to filter out "tip" from a list of tags.
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Jun 2018 16:10:38 +0900] rev 38447
templater: fix truth testing of integer 0 taken from a list/dict
Broken at
f9c426385853. bool(python_value) shouldn't be used here since
an integer 0 has to be truthy for backward compatibility.
Yuya Nishihara <yuya@tcha.org> [Mon, 18 Jun 2018 21:58:04 +0900] rev 38446
formatter: look for template symbols from the associated name
Otherwise symbolsused() would fail if a named template is specified with -T.
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 25 Jun 2018 15:54:56 +0530] rev 38445
py3: add b'' prefixes in tests/test-obsolete-divergent.t
This makes the test pass on Python 3.
# skip-blame because just b'' prefixes.
Differential Revision: https://phab.mercurial-scm.org/D3832
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 25 Jun 2018 01:07:23 +0530] rev 38444
py3: use stringutil.pprint() to print NoneType
Before this patch, when running test-debugcommands.t, we get a TypeError because
NoneType can't be converted into bytes. This patch uses stringutil.pprint() to
print the ui._colormode.
We are now close to getting test-debugcommands.t passing on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D3831
Sushil khanchi <sushilkhanchi97@gmail.com> [Sat, 23 Jun 2018 08:59:18 +0530] rev 38443
rebase: make dry-run return 1 or 0 according to result
In dry-run mode, if there is no conflict return 0, if any then return 1
Differential Revision: https://phab.mercurial-scm.org/D3829
Matt Harbison <matt_harbison@yahoo.com> [Fri, 24 Mar 2017 00:33:35 -0400] rev 38442
relink: use context manager for lock management
Matt Harbison <matt_harbison@yahoo.com> [Fri, 24 Mar 2017 00:32:31 -0400] rev 38441
censor: use context manager for lock management
Yuya Nishihara <yuya@tcha.org> [Thu, 21 Jun 2018 22:33:42 +0900] rev 38440
templater: remove redundant member variables from templater class
We no longer need them since the engine is instantiated in __init__().
Yuya Nishihara <yuya@tcha.org> [Thu, 21 Jun 2018 22:27:30 +0900] rev 38439
templater: resurrect cache of engine instance
The engine-level cache was effectively disabled at
48289eafb37d "templater:
drop extension point of engine classes (API)" by mistake, which made template
rendering quite slow.
Spotted by Martin von Zweigbergk.
Yuya Nishihara <yuya@tcha.org> [Thu, 21 Jun 2018 22:23:43 +0900] rev 38438
templater: extract template loader to separate class
This avoids reference cycle in the subsequent patch:
templater -> _proc -> templater.load -> templater
The templater class will be a thin wrapper around the loader and the engine.