Yuya Nishihara <yuya@tcha.org> [Sat, 18 Mar 2017 19:59:47 +0900] rev 31523
debugtemplate: pass ui to templater so label() works
Follows up 3356bf61fa25.
Durham Goode <durham@fb.com> [Sun, 19 Mar 2017 11:42:17 -0700] rev 31522
merge: remove unnecessary matcher checks
As part of changing manifest.diff to accept a matcher, a previous patch added
matcher calls to each location in merge.manifestmerge that tested if 'x in mf'
to maintain the same behavior as before. After analyzing it further, this
matcher call isn't needed, and in fact hurts future patches ability to use the
matcher here.
Basically, all these 'if x in mf' checks were checking if a matched file's copy
source was in the matcher as well. This meant if you passed a matcher for just
file foo, it would not return file bar even if foo was a copy of bar. Since
manifestmerge cares about copy information, let's allow all lookups of copy
sources.
We also update one spot with a 'is not None' check, since it wasn't obvious that
the value could sometimes be None before, which broke when we called
matcher(None).
A future patch adds matcher optimizations to manifestmerge which causes this
code path to get covered by existing tests.
Durham Goode <durham@fb.com> [Sun, 19 Mar 2017 11:54:15 -0700] rev 31521
rebase: use one dirstateguard for entire rebase
Recently we switched rebases to run the entire rebase inside a single
transaction, which dramatically improved the speed of rebases in repos with
large working copies. Let's also move the dirstate into a single dirstateguard
to get the same benefits. This let's us avoid serializing the dirstate after
each commit.
In a large repo, rebasing 27 commits is sped up by about 20%.
I believe the test changes are because us touching the dirstate gave the
transaction something to actually rollback.
Durham Goode <durham@fb.com> [Fri, 10 Mar 2017 15:52:29 -0800] rev 31520
histedit: add histedit.singletransaction config option
This adds an option (which defaults to False) to run entire histedits in a
single transaction. This results in 20-25% faster histedits in large repos where
transaction startup cost is expensive.
I didn't want to enable this by default because it has some unfortunate side
effects. For instance, if a pretxncommit hook throws midway through the
histedit, it will rollback the entire histedit and lose any progress the user
had made. Same if the user aborts editting a commit message. It's still worth
turning this on for large repos, but probably not for normal sized repos.
Long term, once we have inmemory merging, we could do the entire histedit in
memory, without a transaction, then we could selectively rollback just parts of
it in the event of an exception.
Tested it by running the tests with
`--extra-config-opt=histedit.singletransaction=True`. The only failure was
related to the hook rollback issue I mention above.
Durham Goode <durham@fb.com> [Fri, 10 Mar 2017 15:43:31 -0800] rev 31519
histedit: pop action after the action is completed
We only want to pop the action after the action is completed, since if the
action aborts part way through we want it to remain at the front of the list so
continue/abort will start with it.
Previously we relied on the fact that we only serialized the state file at the
beginning of the action, so the pop wasn't serialized until the next iteration
of the loop. In a future patch we will be adding a large transaction around this
area, which means if we pop the list early it might get serialized if the action
throws a user InterventionRequired error, at which point the action is not in
the list anymore. So let's only pop it once the action is really truly done.
Durham Goode <durham@fb.com> [Fri, 10 Mar 2017 15:43:31 -0800] rev 31518
histedit: add transaction support to writing the state file
This will be used in a future diff to enable a single transaction around an
entire histedit.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:11:00 -0400] rev 31517
localrepo: forcibly copy list of filecache keys
On Python 3, keys() is more like iterkeys(), so we got in trouble for
mutating the dict while we're iterating here. Since the list of caches
should be relatively small, work around this difference by just
forcing a copy of the key list.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:10:02 -0400] rev 31516
localrepo: turn hook kwargs back into strs before calling hook
It might be better to ensure that the hook kwargs dict only has str
keys on Python 3. I'm torn.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:08:59 -0400] rev 31515
localrepo: ensure transaction id is fully bytes on py3
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:08:17 -0400] rev 31514
dirstate: use future-proof next(iter) instead of iter.next
The latter has been removed in Python 3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:06:47 -0400] rev 31513
posix: tiptoe around tempfile module more delicately
Some of the values inside the tempfile calls here are str on Python 3,
so we've got to pass str in. Use fsdecode to work around the issue.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:05:48 -0400] rev 31512
posix: use open() instead of file()
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:05:28 -0400] rev 31511
revlog: use int instead of long
By my reading of PEP 237[0], this is completely safe and has been
since Python 2.2.
0: https://www.python.org/dev/peps/pep-0237/
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:02:42 -0400] rev 31510
error: use r-string to properly pop hints from **kw
Fixes the hint mixin on Python 3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 14:17:07 -0400] rev 31509
dispatch: use pycompat.maplist to allow summing with args
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 14:12:38 -0400] rev 31508
pycompat: add maplist alias for old map behavior
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 14:23:30 -0400] rev 31507
dispatch: replace mayberepr with shellquote
The quoting logic here was actually insufficient, and would have had
bogus b-prefixes on Python 3. shellquote seems more appropriate
anyway. Surprisingly, only two tests have output changes, and both of
them look reasonable to me (both are in blackbox logs).
Spotted by Yuya during review.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 19 Mar 2017 12:44:45 -0400] rev 31506
color: sync text attributes and buffered text output on Windows (issue5508)
I originally noticed that log output wasn't being colored after 3a4c0905f357,
but there were other complications too. With a bunch of untracked files, only
the first 1K of characters were colored pink, and the rest were normal white. A
single modified file at the top would also be colored pink.
Line buffering and full buffering are treated as the same thing in Windows [1],
meaning the stream is either buffered or not. I can't find any explicit
documentation to say stdout is unbuffered by default when attached to a console
(but some internet postings indicated that is the case[2]). Therefore, it seems
that explicit flushes are better than just not reopening stdout.
NB: pager is now on by default, and needs to be disabled to see any color on
Windows.
[1] https://msdn.microsoft.com/en-us/library/86cebhfs(v=vs.140).aspx
[2] https://sourceforge.net/p/mingw/mailman/message/27121137/
Matt Harbison <matt_harbison@yahoo.com> [Sun, 19 Mar 2017 14:42:45 -0400] rev 31505
test-check-help: fix to work on Windows
The initial problem was `hg files` prints paths with '\', which gets removed
when piped (scanhelptopics.py failed to open 'hgext__init__.py'). Then, xargs
was invoking `hg help` with 'backout\r (esc)', which setting binary mode
prevents.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:01:25 -0400] rev 31504
branchmap: be more careful about using %d on ints
Not doing so breaks Python 3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 00:16:39 -0400] rev 31503
util: use bytes re on bytes input in fspath
Fixes `hg add` on Python 3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 00:16:08 -0400] rev 31502
util: use pycompat.bytestr in checkwinfilename
Fixes `hg add` on python3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 00:22:04 -0400] rev 31501
dispatch: ensure repr is bytes in _mayberepr
Fixes command line arguments containing spaces on Python 3.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 00:21:26 -0400] rev 31500
dispatch: extract maybe-use-repr formatting to helper function
I think this makes the code much clearer. I had to think for a bit to
unpack the old-school `condition and if-true or if-false` dance, and
formatting argument lists here shouldn't be performance critical.
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 00:18:53 -0400] rev 31499
dispatch: consolidate formatting of arguments
This was getting done twice, and it's clever enough I'm about to split
it apart and then fix it for Python 3.
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 17 Mar 2017 05:10:58 +0530] rev 31498
py3: make the regular expression bytes to prevent TypeError
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Feb 2017 17:29:30 +0900] rev 31497
pager: flush outputs before firing pager process
So that buffered outputs are always sent to the console.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Feb 2017 17:27:48 +0900] rev 31496
patchbomb: use modern pager to display -n/--test result (BC)
This should provide more consistent UX, but is a BC because the pager will
no longer be fired up for each message.
Yuya Nishihara <yuya@tcha.org> [Sat, 18 Mar 2017 16:02:14 +0900] rev 31495
httpconnection: make sure to clear progress of httpsendfile at EOF
read() should never raise EOFError. If it did, UnboundLocalError would occur
due to unassigned 'ret' variable.
This issue was originally reported to TortoiseHg:
https://bitbucket.org/tortoisehg/thg/issues/4707/
Yuya Nishihara <yuya@tcha.org> [Tue, 14 Mar 2017 18:23:59 +0900] rev 31494
py3: convert log opts to bytes-key dict
Now simple log command works.