Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:59:49 +0900] rev 26018
reachableroots: verify type of each item of heads argument
Though PyInt_AS_LONG() can return a value no matter if it isn't an int object,
it could exceed the boundary of the underlying struct. I think C API should be
defensive to such errors.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:38:46 +0900] rev 26017
reachableroots: verify integer range of heads argument (
issue4775)
Now it raises IndexError instead of SEGV for 'wdir()' as it was before.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 18:29:38 +0900] rev 26016
reachableroots: unify bail cases to raise exception correctly
Before this patch, release_seen_and_tovisit did not return NULL, so the
exception was not raised immediately. As Py_XDECREF() and free() are safe
for NULL, we can simply bail in any case.
Yuya Nishihara <yuya@tcha.org> [Thu, 13 Aug 2015 17:58:33 +0900] rev 26015
reachableroots: pass NULL to PySet_New() as it expects a pointer, not an int
Matt Mackall <mpm@selenic.com> [Wed, 12 Aug 2015 17:01:50 -0500] rev 26014
merge with stable
Durham Goode <durham@fb.com> [Tue, 27 Jan 2015 11:26:27 -0800] rev 26013
copy: add flag for disabling copy tracing
Copy tracing can be up to 80% of rebase time when rebasing stacks of commits in
large repos (hundreds of thousands of files). This provides the option of
turning off the majority of copy tracing. It does not turn off _forwardcopies()
since that is used to carry copy information inside a commit across a rebase.
This will affect the situation where a user edits a file, then rebases on top of
commits that have moved that file. The move will not be detected and the user
will have to manually resolve the issue (possibly by redoing the rebase with
this flag off).
The reason to have a flag instead of trying to fix the actual copy tracing
performance is that copy tracing is fundamentally an O(number of files in the
repo) operation. In order to know if file X in the rebase source was copied
anywhere, we have to walk the filelog for every new file that exists in the
rebase destination (i.e. a file in the destination that is not in the common
ancestor). Without an index that lets us trace forward (i.e. from file Y in the
common ancestor forward to the rebase destination), it will never be an O(number
of changes in my branch) operation.
In mozilla-central, rebasing a 3 commit stack across 20,000 revs goes from 39s
to 11s.
Pierre-Yves David <pierre-yves.david@fb.com> [Sat, 08 Aug 2015 14:50:03 -0700] rev 26012
strip: use the 'finally: tr.release' pattern during stripping
The previous code, was calling 'abort' in all exception cases. This was wrong
when an exception was raised by post-close callback on the transaction. Calling
'abort' on an already closed transaction resulted in a error, shadowing the
original error.
We now use the same pattern as everywhere else. 'tr.release()' will abort the
transaction if we escape the scope without closing it. We add a test to make
sure we do not regress.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 15:06:02 -0400] rev 26011
changelog: trust C implementation of reachableroots more
There are no remaining codepaths in reachableroots where it will
return None, so just trust it completely and simplify this method.
Result by revset
================
Revision:
0) Revision
1c75249e159b: style: adjust whitespaces in webutil.py
1) Revision
d1d91b8090c6: changelog: trust C implementation of reachableroots more
revset #0: 0::tip
plain
0) 0.067684
1) 0.006622 9%
revset #1: 0::@
plain
0) 0.068249
1) 0.009394 13%
IOW this is a 10x speedup in my repo for hg itself for 0::tip and
similar revsets now that the C code is correctly wired up.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:53:47 -0400] rev 26010
reachableroots: return NULL if we're throwing an exception
Based on my reading of [0] and surrounding sections, if we want an
exception to be properly raised when something goes wrong in the C
code, we need to make sure we return NULL here. Do so.
https://docs.python.org/2/extending/extending.html#back-to-the-example
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 15:34:10 -0400] rev 26009
reachableroots: fix transposition of set and list types in PyArg_ParseTuple
This is being masked by the function not properly returning NULL when
it raises an exception, so the client code was just falling back to
the native codepath when it got None back. A future change removes all
reason for this C function to return None, which exposed this problem
during development.
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:50:39 -0400] rev 26008
reachableroots: consistently use short-form of PyErr_NoMemory()
Augie Fackler <augie@google.com> [Tue, 11 Aug 2015 14:49:40 -0400] rev 26007
reachableroots: if allocating a new set fails, use PyErr_NoMemory()
My inspection of the implementation of PySet_New() indicates that it
does *not* reliably set an exception in the cases where it returns
NULL (as far as I can tell it'll never do that!), so let's set that up
ourselves.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 22:11:20 -0700] rev 26006
reachableroots: default to the C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on is
2x-5x faster.
Before this patch, reachableroots was computed in pure Python by default. This
patch makes the C implementation the default and provides a speedup for
reachableroots.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 22:10:31 -0700] rev 26005
changelog: add way to call the reachableroots C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is
to speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on
is 2x-5x faster.
This patch allows us to call the new C implementation of reachableroots from
python by creating an entry point in the changelog class.
Laurent Charignon <lcharignon@fb.com> [Thu, 06 Aug 2015 21:28:45 -0700] rev 26004
reachableroots: add a C implementation
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of reachableroots is 10-50x faster and smartlog on is
2x-5x faster.
This patch introduces a C implementation for reachableroots following closely the
Python implementation but optimized by using C data structures.
Laurent Charignon <lcharignon@fb.com> [Fri, 19 Jun 2015 20:28:52 -0700] rev 26003
revset: remove grandparent by using reachableroots
This patch is part of a series of patches to speed up the computation of
revset.reachableroots by introducing a C implementation. The main motivation
is to speed up smartlog on big repositories. At the end of the series, on our
big repositories the computation of reachableroots is 10-50x faster and
smartlog on is 2x-5x faster.
Before this patch, we had a custom computation for grandparent that was very
close to the idea of reacheablerooots. This patch expresses grandparent with
reachableroots to reduce the amount of code.
Laurent Charignon <lcharignon@fb.com> [Fri, 19 Jun 2015 20:18:54 -0700] rev 26002
revset: rename revsbetween to reachableroots and add an argument
This patch is part of a series of patches to speed up the computation of
revset.revsbetween by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of revsbetween is 10-50x faster and smartlog on is
2x-5x faster.
This patch rename 'revsbetween' to 'reachableroots' and makes the computation of
the full path optional. This will allow graphlog to compute grandparents using
'reachableroots' and remove the need for a dedicated grandparent function.
Laurent Charignon <lcharignon@fb.com> [Fri, 07 Aug 2015 02:13:42 -0700] rev 26001
revset: make revsbetween public
This patch is part of a series of patches to speed up the computation of
revset.revsbetween by introducing a C implementation. The main motivation is to
speed up smartlog on big repositories. At the end of the series, on our big
repositories the computation of revsbetween is 10-50x faster and smartlog on is
2x-5x faster.
Later in this serie, we want to reuse the implementation of revsbetween in the
changelog module, therefore, we make it public.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 06 Aug 2015 21:00:16 -0400] rev 26000
match: fix a caseonly rename + explicit path commit on icasefs (
issue4768)
The problem was that the former name and the new name are both normalized to the
case in dirstate, so matcher._files would be ['ABC.txt', 'ABC.txt'].
localrepo.commit() calls localrepo.status(), passing along the matcher. Inside
dirstate.status(), _walkexplicit() simply grabs matcher.files() and processes
those items. Since the old name isn't present, it is silently dropped. There's
a fundamental tension here, because the status command should also accept files
that don't match the filesystem, so we can't drop the normalization in status.
The problem originated in
baa11dde8c0e.
Unfortunately with this change, the case of the old file must still be specified
exactly, or the old file is again silently excluded. I went back to
baa11dde8c0e^, and that had the same behavior, so we are no worse off. I'm open
to ideas from a matcher or dirstate expert on how to fix that half.
Anton Shestakov <av6@dwimlabs.net> [Tue, 11 Aug 2015 13:19:42 +0800] rev 25999
style: adjust whitespaces in webutil.py
Turns out, all this came from the single
d605a82cf189.
Matt Mackall <mpm@selenic.com> [Mon, 10 Aug 2015 15:30:28 -0500] rev 25998
merge with stable
Durham Goode <durham@fb.com> [Thu, 06 Aug 2015 17:21:46 -0700] rev 25997
convert: fix git copy file content conversions
There was a bug in the git convert code where if you copied a file and modified
the copy source in the same commit, and if the copy dest was alphabetically
earlier than the copy source, the converted version would use the copy dest
contents for both the source and the target.
The root of the bug is that the git diff-tree output is formatted like so:
:<mode> <mode> <oldhash> <newhash> <state> <src> <dest>
:100644 100644
c1ab79a15...
3dfc779ab... C069 oldname newname
:100644 100644
c1ab79a15...
03e2188a6... M oldname
The old code would always take the 'oldname' field as the name of the file being
processed, then it would try to do an extra convert for the newname. This works
for renames because it does a delete for the oldname and a create for the
newname.
For copies though, it ends up associating the copied content (
3dfc779ab above)
with the oldname. It only happened when the dest was alphabetically before
because that meant the copy got processed before the modification.
The fix is the treat copy lines as affecting only the newname, and not marking
the oldname as processed.
Yuya Nishihara <yuya@tcha.org> [Sun, 09 Aug 2015 16:09:41 +0900] rev 25996
revset: prevent crash caused by empty group expression while optimizing "or"
An empty group expression "()" generates None in AST, so it should be tested
before destructuring a tuple.
"A | ()" is still evaluated to an error because I'm not sure whether "()"
represents an empty set or an empty expression (= a unit value). They are
identical in "or" operation, but they should be evaluated differently in
"and" operation.
expression empty set unit value
---------- --------- ----------
() {} A
A & () {} A
A | () A A
Yuya Nishihara <yuya@tcha.org> [Sun, 09 Aug 2015 16:06:36 +0900] rev 25995
revset: prevent crash caused by empty group expression while optimizing "and"
An empty group expression "()" generates None in AST, so the optimizer have
to test it before destructuring a tuple. The error message, "missing argument",
is somewhat obscure, but it should be better than crash.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:52:59 -0700] rev 25994
win32: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:53:17 -0700] rev 25993
wireproto: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:44:41 -0700] rev 25992
worker: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:48:10 -0700] rev 25991
verify: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:14:50 -0700] rev 25990
url: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:25:41 -0700] rev 25989
ui: use absolute_import
And we have no more ambiguous mixed imports \o/
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:13:11 -0700] rev 25988
unionrepo: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:11:56 -0700] rev 25987
treediscovery: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:10:23 -0700] rev 25986
transaction: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:23:53 -0700] rev 25985
templater: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:09:43 -0700] rev 25984
templatekw: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:08:52 -0700] rev 25983
templatefilters: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:16:56 -0700] rev 25982
tags: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:10:46 -0700] rev 25981
tagmerge: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:03:58 -0700] rev 25980
subrepo: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:01:40 -0700] rev 25979
strutil: use absolute_import
This file doesn't import anything. But chances are we'll eventually
implement a static analysis check that ensures absolute_import is used.
So we might as well add this.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 20:11:08 -0700] rev 25978
statichttprepo: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:56:22 -0700] rev 25977
sslutil: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:55:39 -0700] rev 25976
sshserver: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:55:01 -0700] rev 25975
sshpeer: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:54:11 -0700] rev 25974
simplemerge: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:53:25 -0700] rev 25973
setdiscovery: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 19:58:05 -0700] rev 25972
repoview: use absolute_import
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 08 Aug 2015 18:36:58 -0700] rev 25971
revset: use absolute_import