Jun Wu <quark@fb.com> [Fri, 02 Jun 2017 19:32:27 -0700] rev 32688
obsstore: minor optimization for the obsolete revset
Use local variables in a loop.
Yuya Nishihara <yuya@tcha.org> [Sun, 23 Apr 2017 00:31:29 +0900] rev 32687
dispatch: do not close stdout and stderr, just flush() instead
Since
3a4c0905f357 "util: always force line buffered stdout when stdout is
a tty", we have two file objects attached to the same STDOUT_FILENO. If one
is closed, the underlying file descriptor is also closed, and writing to
the other file object would crash the Python interpreter in a hard way, at
least on Windows.
So, it seems safer to not close the standard streams. This also matches
the behavior of the default sys.stdout/stderr.close(), which never close
the FILE* streams in C layer.
https://hg.python.org/cpython/file/v2.7.13/Python/sysmodule.c#l1401
Yuya Nishihara <yuya@tcha.org> [Mon, 05 Jun 2017 23:36:35 +0900] rev 32686
windows: do not close stdout on flush() failure
It's been there since
e817c68edfed (2007-02-19), but seems wrong since any
I/O operations to a closed file would raise ValueError, not IOError. We should
keep the file object open even if the underlying file descriptor is half dead.
Yuya Nishihara <yuya@tcha.org> [Mon, 05 Jun 2017 23:23:03 +0900] rev 32685
test-obsolete-bundle-strip: do not include \n in filename (
issue5586)
Yuya Nishihara <yuya@tcha.org> [Fri, 19 Aug 2016 18:26:04 +0900] rev 32684
revlog: add support for partial matching of wdir node id
The idea is simple. If the given node id prefix is 'ff...f', add +1 to the
number of matches (e.g. ambiguous if partial + maybewdir > 1).
This patch also fixes id() revset and shortest() template since _partialmatch()
can raise WdirUnsupported exception.
Yuya Nishihara <yuya@tcha.org> [Sat, 20 Aug 2016 18:15:19 +0900] rev 32683
revset: add support for branch(wdir()) and wdir() & branch()
Siddharth Agarwal <sid0@fb.com> [Sun, 04 Jun 2017 16:08:50 -0700] rev 32682
dirstate: add docstring for invalidate
This always confuses me, and we already have a docstring on
localrepo.invalidatedirstate.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 02 Jun 2017 23:05:03 -0700] rev 32681
tests: simplify and clarify test-obsolete-bundle-strip.t a little
Martin von Zweigbergk <martinvonz@google.com> [Fri, 02 Jun 2017 23:29:20 -0700] rev 32680
tests: add missing parens in test-obsolete-bundle-strip.t
The "(not ${revs})" was missing parens around ${revs}, so when revs
was "A + B", it became "(not A + B)" when actually "(not (A + B))" was
intended. Fixing that leads to some more testing of strip.
Similarly, the parens were missing in "${revs}::", making it "A + B::"
instead of "(A + B)::". Thanks to Yuya for noticing this part. This
did not affect any existing tests.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 04 Jun 2017 20:37:32 -0400] rev 32679
test-clonebundles: conditionalize output for Windows
This was the fallout from
9d6031df42c8 (on stable). Now that individual lines
can be conditionalized, it seems better to be explicit, rather than mash all of
this into one regex. "getaddrinfo failed" was added in
4e566f513fd8 to support
Windows.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 04 Jun 2017 20:11:59 -0400] rev 32678
tests: adjust recent output changes for Windows
Matt Harbison <matt_harbison@yahoo.com> [Mon, 22 May 2017 21:45:02 -0400] rev 32677
killdaemons: close pid file before killing processes
With #serve enabled on Windows, I was getting occasional stacktraces like this:
Errored test-hgweb-json.t: Traceback (most recent call last):
File "./run-tests.py", line 724, in run
self.tearDown()
File "./run-tests.py", line 805, in tearDown
killdaemons(entry)
File "./run-tests.py", line 540, in killdaemons
logfn=vlog)
File "...\tests\killdaemons.py", line 94, in killdaemons
os.unlink(pidfile)
WindowsError: [Error 32] The process cannot access the file because it is
being used by another process: '...\\hgtests.zmpqj3\\child80\\daemon.pids'
Adrian suggested using util.posixfile, which works. However, the 'mercurial'
package isn't in sys.path when invoking run-tests.py, and it isn't clear that
hacking[1] it in is a good thing (especially for test-run-tests.t, which uses an
installation in a temp folder).
I tried using ProcessMonitor to figure out what the other process is, but that
monitoring slows things down to such a degree that the issue doesn't occur. I
was ready to blame the virus scanner, but it happens without that too.
Looking at the code, I don't see anything that would have the pid file open.
But I was able to get through about 20 full test runs without an issue with this
minor change, whereas before it was pretty certain to hit this at least once in
two or three runs.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-May/097907.html
Matt Harbison <matt_harbison@yahoo.com> [Sun, 21 May 2017 18:58:51 -0400] rev 32676
win32: drop a py26 daemonizing hack
I'm not sure what the referenced hang specifically was, but the whole test suite
(with #serve) still runs on python 2.7.13. Aside from no longer prepending
"cmd.exe /c", this backs out
ca6aa8362f33.
I'm trying to track down a rare failure of TerminateProcess() with an access
error, and I've seen random extra python processes hanging around after running
tests sometimes, so this might help.
However,
e48cb1c7a902 forces this change. Since the pid object is no longer
converted to a string, the cmd.exe pid was being saved instead of the hg pid,
and none of the daemons were being killed.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:23:30 +0200] rev 32675
checkheads: simplify the code around obsolescence post-processing
The 'discardedheads' return become unused and the relationship between newheads
and newhs can be clarified. Our next goal here is to be able to extract the
_postprocessobsolete call outside of the loop.
We keep returning the 'discardedheads' because we'll start using it again soon
in this series.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:21:38 +0200] rev 32674
checkheads: drop now unused filtering of 'unsyncedheads'
Now that unsynced heads are no longer in the function inputs or returns, we can
simplify the code a bit.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:20:09 +0200] rev 32673
checkheads: clarify that we no longer touch the head unknown locally
Since
c6cb21ddf74a, heads unknown locally no longer get any post processing
from obsolescence markers. We clarify this fact by only feeding the list of
locally known new heads to the function. This simplification of the input will
help moving that post-processing earlier in the function.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:33:59 +0200] rev 32672
headssummary: ensure all returned lists are sorted
This is a simple step that will help to keep a stable output in coming
refactoring.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:37:19 +0200] rev 32671
discovery: also use lists for the returns of '_oldheadssummary'
The '_headssummary' function is documenting and using list objects in its
return. We now use them in _oldheadssummary too for consistency. This does not
affect any usages of these values.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:53:51 +0200] rev 32670
test: add a push race case where the updated head is obsoleted
This is the mirror of the previously added case. We check the case where the
racing-push obsoletes a head while the raced-push updates that same head.
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 29 May 2017 05:53:24 +0200] rev 32669
test: add a push race case where obsoleted head is updated
We check the case where the raced-push obsoletes a head while the racing-push
updates that same head.
Kyle Lippincott <spectral@google.com> [Fri, 02 Jun 2017 14:08:26 -0700] rev 32668
keepalive: set buffering=True to do more efficient reads of headers
Support for buffering was added to python in
d09d6fe31b61, first released with
python2.7. Without this, the entirety of the response headers is read
byte-by-byte (it does more efficient reads when it gets to the non-header part
of the response).
Kyle Lippincott <spectral@google.com> [Thu, 01 Jun 2017 18:23:20 -0700] rev 32667
keepalive: pass the correct arguments to HTTPResponse
python2.7's httplib.HTTPResponse takes the arguments in the following order:
sock, debuglevel, strict, method, buffering
This was previously passing them in as positional and skipped strict, so we set
strict=method. I'm explicitly setting strict=True now to preserve the previous
behavior that has been there since this file was created.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 22 May 2017 22:32:59 -0400] rev 32666
help: update the color documentation for Windows 10 ANSI support
It looks like only the initial release of Windows 10 lacked support for this
functionality. [1][2] Since that build is no longer supported, I didn't bother
getting very specific, to keep the help text less cluttered.
[1] https://github.com/symfony/symfony/issues/17499#issuecomment-
243481052
[2] https://en.wikipedia.org/wiki/Windows_10_version_history
Matt Harbison <matt_harbison@yahoo.com> [Mon, 22 May 2017 22:20:38 -0400] rev 32665
color: enable ANSI support on Windows 10
This will display color if "color.mode=ansi", and default to 'ansi' if the mode
is set to 'auto'. The 'debugcolor' command also reflects this policy.
Previously, "color.mode=ansi" on Windows printed jibberish around the normal
text. Using ANSI color is better, as it avoids the normal loss of color when
the default pager is enabled on Windows. See also
issue5570.
When the underlying function fails (e.g. when run on older Windows), 'auto'
still falls back to 'win32'. Apparently, Microsoft originally had this feature
turned on by default, and then made it opt-in[1]. Therefore, not enabling it
unconditionally seems safer. Instead, only do it after processing the existing
check for support in a Unix-like environment.
[1] https://github.com/symfony/symfony/issues/17499#issuecomment-
243481052
Matt Harbison <matt_harbison@yahoo.com> [Mon, 22 May 2017 22:00:56 -0400] rev 32664
win32: add a method to enable ANSI color code processing on Windows 10
SetConsoleMode() fails with an invalid parameter error if given this option
prior to Windows 10, so indicate that to the caller instead of doing explicit
version checks.
Kevin Bullock <kbullock+mercurial@ringworld.org> [Sun, 04 Jun 2017 08:57:37 -0500] rev 32663
merge with stable
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 19:17:19 +0900] rev 32662
export: map wctx.node() to 'ff...' node id (
issue5438)
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 20:39:33 +0900] rev 32661
revset: add support for integer and hex wdir identifiers
As I said before, partial 'ff...' hash isn't supported yet.
Yuya Nishihara <yuya@tcha.org> [Fri, 19 Aug 2016 18:40:35 +0900] rev 32660
localrepo: map integer and hex wdir identifiers to workingctx
changectx.__init__() is slightly modified to take str(wdirrev) as a valid
integer revision (and raise WdirUnsupported exception.)
Test will be added by the next patch.
Yuya Nishihara <yuya@tcha.org> [Sat, 20 Aug 2016 22:37:58 +0900] rev 32659
revlog: map rev(wdirid) to WdirUnsupported exception
This will allow us to map repo["ff..."] to workingctx. _partialmatch() will
be updated later. I tried "return wdirrev" in place of raising the exception,
but earlier exception seemed better.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 19:12:01 +0900] rev 32658
scmutil: introduce binnode(ctx) as paired function with intrev(ctx)
It seemed silly to convert ctx.hex() back to binary to use node.hex/short(),
or to use [:12] instead of node.short() because ctx.node() could be None.
Eventually I want to change wctx.rev() and wctx.node() to return wdirrev and
wdirid respectively, but that's quite big API breakage and can't be achieved
without some compatibility wrappers.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 19:01:19 +0900] rev 32657
merge: use scmutil.intrev() to sort ctx objects
This moves wctx to the last, but that shouldn't matter. Only the order of
stored revisions is important.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 18:57:28 +0900] rev 32656
scmutil: pass ctx object to intrev()
This makes it slightly easier to sort basectx objects by key=scmutil.intrev.
We're most likely to have ctx objects where changectx/workingctx abstraction
is necessary, so this won't increase the abstraction overhead.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 14:05:52 +0900] rev 32655
setup: do not overwrite local __modulepolicy__.py on out-of-source build
Since the default policy is selected depending on setup options, "make install"
shouldn't overwrite in-source __modulepolicy__.py generated by "make local".
Kevin Bullock <kbullock@ringworld.org> [Sun, 04 Jun 2017 08:16:37 -0500] rev 32654
Added signature for changeset
c850f0ed54c1
Kevin Bullock <kbullock@ringworld.org> [Sun, 04 Jun 2017 08:16:29 -0500] rev 32653
Added tag 4.2.1 for changeset
c850f0ed54c1
Augie Fackler <augie@google.com> [Sat, 03 Jun 2017 16:33:28 -0400] rev 32652
merge with stable
Siddharth Agarwal <sid0@fb.com> [Fri, 02 Jun 2017 22:27:52 -0700] rev 32651
status: don't crash if a lookup file disappears
This can happen if another process (even another hg process!) comes along and
removes the file at that time.
This partly resolves
issue5584, but not completely -- a bogus dirstate update
can still happen. However, the full fix is too involved for stable.
Martin von Zweigbergk <martinvonz@google.com> [Thu, 01 Jun 2017 08:31:21 -0700] rev 32650
match: simplify nevermatcher
Most of it does the same as its superclass, so it can simply be
removed. It also seems to make more sense for it to use relative
paths, as we do for everything except alwaysmatcher, although
nevermatcher.uipath() will probably never get called anyway, so it
won't matter.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 00:25:24 +0900] rev 32649
annotate: restructure formatter output to be nested list (BC)
Annotate data should be in [(file, [line...])...] form, but there was no
API to represent such data structure when I ported it to formatter. Now
we have fm.nested() and the -T option is still experimental, so we can fix
the data format.
Yuya Nishihara <yuya@tcha.org> [Sat, 03 Jun 2017 00:05:12 +0900] rev 32648
annotate: rename formatter variable
So we can add a nested 'fm' of narrow scope.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 07 May 2017 23:29:03 -0400] rev 32647
setup: prevent setuptools from laying an egg
Previously, test-hghave.t was failing on Windows (and on Linux if
$FORCE_SETUPTOOLS was set) with the following:
--- c:/Users/Matt/Projects/hg/tests/test-hghave.t
+++ c:/Users/Matt/Projects/hg/tests/test-hghave.t.err
@@ -19,7 +19,11 @@
> foo
> EOF
$ run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
+ warning: Testing with unexpected mercurial lib: c:\Users\Matt\Projects\hg\mercurial
+ (expected ...\hgtests.mu9rou\install\lib\python\mercurial)
.
+ warning: Tested with unexpected mercurial lib: c:\Users\Matt\Projects\hg\mercurial
+ (expected ...\hgtests.mu9rou\install\lib\python\mercurial)
Augie relayed concerns[1] about the first attempt at this, which also excluded
'install_egg_info'. All that needs to be excluded to avoid the egg and make the
test work is to filter out 'bdist_egg'. (Actually, the body of this class could
simply be 'pass', and 'bdist_egg' still isn't run. But that seems to magical.)
Also note that prior to this (and still now), `make clean` doesn't delete the
'mercurial.egg-info' that is generated by `make install`.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-May/097668.html
# no-check-commit
Martin von Zweigbergk <martinvonz@google.com> [Fri, 02 Jun 2017 10:32:39 -0700] rev 32646
bitmanipulation: add missing include of string.h
That's where memcpy() is declared.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 01 Jun 2017 02:41:19 +0530] rev 32645
py3: add test to show `hg update` and `hg identify` works on Python 3
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Jun 2017 10:14:00 +0530] rev 32644
py3: add a test to show `hg diff` works on Python 3
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 01 Jun 2017 02:25:18 +0530] rev 32643
py3: implement __bytes__ for committablectx
Before this method, calling bytes on workingctx or memctx calls
basectx.__bytes__ since the magic method was not defined for this class. When it
calls the method from basectx class, it returns TypeError because None is passed
into it.
After this commit `hg update -C` works on Python 3 if eol is not enabled.
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 02 Jun 2017 10:35:21 +0530] rev 32642
py3: convert exception to bytes to pass into ui.warn()
Here encoding.strtolocal() is used because exc maybe an IOError which could
contain a valid non-ascii unicode.
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 01 Jun 2017 02:14:26 +0530] rev 32641
py3: convert bool variables to bytes before passing into ui.debug()
We can't pass unicodes to ui.debug() and hence we need to convert things to
bytes before passing them.