Pulkit Goyal <7895pulkit@gmail.com> [Sun, 01 Jul 2018 00:52:25 +0530] rev 38521
rebase: use staeobj to check whether interrupted rebase exists
This cleans up the code a bit.
Differential Revision: https://phab.mercurial-scm.org/D3875
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 01 Jul 2018 00:46:59 +0530] rev 38520
rebase: add a stateobj variable to rebaseruntime class
The stateobj variable is an object of state.cmdstate() and will be used in
upcoming patches to clean up the logic a bit and also use cbor format to write
data to rebasestate class.
Differential Revision: https://phab.mercurial-scm.org/D3874
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 01 Jul 2018 00:31:57 +0530] rev 38519
rebase: refactor logic to read rebasestate in a separate function
This will help us in plugging the use of state.cmdstate() to read rebasestate.
Differential Revision: https://phab.mercurial-scm.org/D3873
Boris Feld <boris.feld@octobus.net> [Fri, 22 Jun 2018 00:07:22 +0100] rev 38518
revlog: reuse 'descendant' implemention in 'isancestor'
The two functions do the same thing, but one takes nodes while the other takes
revs. Using one to implement the other make sense.
We should probably cleanup the API at some point to avoid having so many similar
functions. However, we focus on an efficient implementation for now.
Boris Feld <boris.feld@octobus.net> [Fri, 22 Jun 2018 00:05:20 +0100] rev 38517
revlog: efficient implementation of 'descendant'
Iterating over descendants is costly, because there are no "parent -> children"
pointers. Walking the other way around is much more efficient, especially on
large repositories, where descendant walks can cost seconds. And the other hand,
common ancestors code follows links in the right direction and has a compiled
implementation.
In real life usage, this saved up to 80s during some pull operations, where
descendant test happens in extension code.
Boris Feld <boris.feld@octobus.net> [Thu, 21 Jun 2018 23:56:51 +0100] rev 38516
revlog: refactor out the rev-oriented part of commonancestorheads
We plan to use this in a function taking revs as argument. Round trips to nodes
seem silly.
Boris Feld <boris.feld@octobus.net> [Thu, 21 Jun 2018 23:53:43 +0100] rev 38515
revlog: do inclusive descendant testing (API)
In many other places, a revision is considered a descendant of itself. We
update the behavior of `revlog.descendant()` to match this. (for example.
`revlog.isancestor` does inclusive testing).
No tests break, so it seems safe to do so.
This will make it easier to use a more efficient implementation in a later
changeset.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 30 Jun 2018 16:06:05 -0700] rev 38514
manifest: make cachesize a private attribute
AFAICT this isn't accessed outside the class. It is a private
attribute and its naming should reflect that.
Differential Revision: https://phab.mercurial-scm.org/D3868
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 30 Jun 2018 15:51:04 -0700] rev 38513
repository: document that file() return value conforms to interface
Differential Revision: https://phab.mercurial-scm.org/D3867
Yuya Nishihara <yuya@tcha.org> [Sun, 01 Jul 2018 21:40:55 +0900] rev 38512
cleanup: pass in overwrite flag to hg.updaterepo() as named argument
For clarity.
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 30 Jun 2018 07:23:02 +0530] rev 38511
histedit: use self.stateobj to check whether interrupted histedit exists
self.stateobj is an instance of state.cmdstate() class which has an .exists()
function which is used to check whether there exists an interrupted statefile or
not.
Differential Revision: https://phab.mercurial-scm.org/D3865
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 30 Jun 2018 07:21:21 +0530] rev 38510
histedit: add a stateobj variable to histeditstate class
The stateobj variable will be an instance of state.cmdstate() class. The
stateobj variable will be used in upcoming patches to simplify the code a bit
and start using cbor to write state files.
Differential Revision: https://phab.mercurial-scm.org/D3864
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 30 Jun 2018 07:10:49 +0530] rev 38509
histedit: factor out logic of processing state data in separate fn
The new function will serve as the point from where we always get a dictionary
of data stored in the statefile and will be helpful in integrating
state.cmdstate.read() to write statefile in cbor.
Differential Revision: https://phab.mercurial-scm.org/D3863
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 30 Jun 2018 07:05:36 +0530] rev 38508
histedit: use hg.updaterepo() to avoid ui.{push|pop}buffer() hack
In some parts of code, we call hg.update() and surround that with
ui.pushbuffer() and ui.popbuffer() to suppress the output returned by
hg.update().
We have hg.updaterepo() which does not writes to UI and can be used instead.
Differential Revision: https://phab.mercurial-scm.org/D3862
Danny Hooper <hooper@google.com> [Fri, 29 Jun 2018 14:43:41 -0700] rev 38507
scmutil: fix __enter__ in progress context manager
Differential Revision: https://phab.mercurial-scm.org/D3861
Martin von Zweigbergk <martinvonz@google.com> [Fri, 29 Jun 2018 14:14:35 -0700] rev 38506
httppeer: fix use of uninitialized variable with devel logging
If the request fails, "res" was uninitialized.
Differential Revision: https://phab.mercurial-scm.org/D3860
Yuya Nishihara <yuya@tcha.org> [Sat, 30 Jun 2018 11:33:05 +0900] rev 38505
rebase: convert opts dict to bytes at once
Yuya Nishihara <yuya@tcha.org> [Sat, 30 Jun 2018 11:29:48 +0900] rev 38504
rebase: isolate command options from internal flags
I want to get rid of per-function byteskwargs(opts).
Sushil khanchi <sushilkhanchi97@gmail.com> [Fri, 29 Jun 2018 01:05:08 +0530] rev 38503
rebase: suppress warning thrown when aborting rebase in case of dryrun
Before this patch dryrun output contained "rebase aborted" every
time we run rebase in dryrun mode and this warning does not sound
safe from a user prespective.
Differential Revision: https://phab.mercurial-scm.org/D3857
Sushil khanchi <sushilkhanchi97@gmail.com> [Fri, 29 Jun 2018 00:47:33 +0530] rev 38502
rebase: no need to store backup in case of dryrun
While aborting an unfinished rebase in case of dryrun
there is no need to store backup for those rebased csets.
Differential Revision: https://phab.mercurial-scm.org/D3827
Sushil khanchi <sushilkhanchi97@gmail.com> [Fri, 29 Jun 2018 00:22:50 +0530] rev 38501
rebase: split _origrebase() for conveniece in dryrun
This patch split _origrebase() method by extracting rbsrt part
from that to make it easy to implement dryrun in more elegant way
than before.
Differential Revision: https://phab.mercurial-scm.org/D3856
Sushil khanchi <sushilkhanchi97@gmail.com> [Thu, 28 Jun 2018 23:57:15 +0530] rev 38500
rebase: extract dryrun as a function
To avoid more number of indented blocks and make it easier to add
additional functionality in dryrun, extracted as a function.
Differential Revision: https://phab.mercurial-scm.org/D3855
Sushil khanchi <sushilkhanchi97@gmail.com> [Thu, 28 Jun 2018 23:36:45 +0530] rev 38499
rebase: add lock to cover whole dryrun process
Before this patch it is easy for another hg to interrupt
the dryrun. This patch make sure that dryrun will complete
without any interruption.
Differential Revision: https://phab.mercurial-scm.org/D3854
Boris Feld <boris.feld@octobus.net> [Tue, 29 May 2018 00:26:20 +0200] rev 38498
merge: add a 'keepconflictparent' argument to graft
Before this change, `merge.graft` was always dropping the "grafted" changeset
from the parent. This is impractical in case of conflict as the second parent
can be useful to help with conflict resolution.
We add a new boolean parameter to control this behavior. This will make using
`merge.graft` directly in shelve practicable.
Differential Revision: https://phab.mercurial-scm.org/D3692
Kyle Lippincott <spectral@google.com> [Thu, 28 Jun 2018 18:07:22 -0700] rev 38497
unlinkpath: make empty directory removal optional (issue5901) (issue5826)
There are known cases where performing operations such as rebase from a
directory that is newly created can fail or at least lead to being in a
directory handle that no longer exists.
This is even reproducible by just doing something as simple as:
cd foo; hg rm *
The behavior is different if you use `hg addremove`, the directory is not
removed until we attempt to go back to the node after committing it:
cd foo; rm *; hg addremove; hg ci -m'bye foo'; hg co .^; hg co tip
Differential Revision: https://phab.mercurial-scm.org/D3859
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 28 Jun 2018 21:24:47 +0530] rev 38496
py3: convert opts keys to bytes using pycompat.byteskwargs()
This fixes the py3 build broken due to
56b2074114b19e12abd9cd4c378d58b702232705.
Differential Revision: https://phab.mercurial-scm.org/D3853
Matt Harbison <matt_harbison@yahoo.com> [Thu, 28 Jun 2018 22:23:08 -0400] rev 38495
procutil: add a shim for translating shell commands to native commands
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 23:26:40 +0900] rev 38494
revset: move lookup of first ancestor() candidate out of the loop
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 23:21:47 +0900] rev 38493
revset: leverage orset() to flatten ancestor() arguments
This also makes orset() accept an empty argument because nullary ancestor()
call is valid. That's not the case for orset(), but should be okay.
Yuya Nishihara <yuya@tcha.org> [Sat, 16 Jun 2018 23:12:41 +0900] rev 38492
revset: remove orphan i18n comment from ancestor()
Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com> [Thu, 28 Jun 2018 23:21:55 +0530] rev 38491
grep: deprecates `--all` flag
As the name "all" is a misnomer for an option that searches on diffs of revisions,
we are moving to diff flag from all, deprecating it in the process.
Differential Revision: https://phab.mercurial-scm.org/D3825
Martin von Zweigbergk <martinvonz@google.com> [Tue, 26 Jun 2018 10:02:01 -0700] rev 38490
namespaces: let namespaces override singlenode() definition
Some namespaces have multiple nodes per name (meaning that their
namemap() returns multiple nodes). One such namespace is the "topics"
namespace (from the evolve repo). We also have our own internal
namespace at Google (for review units) that has multiple nodes per
name. These namespaces may not want to use the default "pick highest
revnum" resolution that we currently use when resolving a name to a
single node. As an example, they may decide that `hg co <name>` should
check out a commit that's last in some sense even if an earlier commit
had just been amended and thus had a higher revnum [1]. This patch
gives the namespace the option to continue to return multiple nodes
and to override how the best node is picked. Allowing namespaces to
override that may also be useful as an optimization (it may be cheaper
for the namespace to find just that node).
I have been arguing (in D3715) for using all the nodes returned from
namemap() when resolving the symbol to a revset, so e.g. `hg log -r
stable` would resolve to *all* nodes on stable, not just the one with
the highest revnum (except that I don't actually think we should
change it for the branch namespace because of BC). Most people seem
opposed to that. If we decide not to do it, I think we can deprecate
the namemap() function in favor of the new singlenode() (I find it
weird to have namespaces, like the branch namespace, where namemap()
isn't nodemap()'s inverse). I therefore think this patch makes sense
regardless of what we decide on that issue.
[1] Actually, even the branch namespace would have wanted to override
singlenode() if it had supported multiple nodes. That's because
closes branch heads are mostly ignored, so "hg co default" will
not check out the highest-revnum node if that's a closed head.
Differential Revision: https://phab.mercurial-scm.org/D3852
Sushil khanchi <sushilkhanchi97@gmail.com> [Wed, 27 Jun 2018 12:24:21 +0530] rev 38489
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 38488
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 38487
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 38486
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 38485
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 38484
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 38483
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 38482
test-revset: show that order of heads() can be wrong
Augie Fackler <augie@google.com> [Wed, 27 Jun 2018 10:21:07 -0400] rev 38481
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 38480
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 38479
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 38478
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 38477
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 38476
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 38475
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 38474
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