Anton Shestakov <engored@ya.ru> [Wed, 03 Jun 2015 18:30:25 +0800] rev 25586
tests: test symbolic revision (de)reference in all hgweb styles
Right now the way revisions get specified in hgweb urls is ignored, i.e. after
revision is resolved, only its node hash (or sometimes local revision number)
is used for all links in the templates. So, basically, every page for "tip"
revision (or any other symbolic rev id) will dereference it: lose the nice
symbolic name by putting node hash/local rev number in its place. The only
exception so far is archive links on some pages: /archive/tip.{bz2,gz,zip}.
The fact that this dereferencing is neither convenient nor intuitive is
reflected in
issue2296,
issue2826 and
issue3594.
issue3634 also mentions this.
But to fix this it's first needed to demonstrate and test the way templates
currently form links.
The new test file is separate from other hgweb tests, since it seems big and
distinct enough. And it's so big because links are formed in each template
independently, so it's necessary to test them all to avoid any inconsistent
behavior.
Siddharth Agarwal <sid0@fb.com> [Tue, 16 Jun 2015 00:46:01 -0700] rev 25585
dirstate: use a presized dict for the dirstate
This uses a simple heuristic to avoid expensive resizes.
On a real-world repo with around 400,000 files, perfdirstate:
before: ! wall 0.155562 comb 0.160000 user 0.150000 sys 0.010000 (best of 64)
after: ! wall 0.132638 comb 0.130000 user 0.120000 sys 0.010000 (best of 75)
On another real-world repo with around 250,000 files:
before: ! wall 0.098459 comb 0.100000 user 0.090000 sys 0.010000 (best of 100)
after: ! wall 0.089084 comb 0.090000 user 0.080000 sys 0.010000 (best of 100)
Siddharth Agarwal <sid0@fb.com> [Mon, 15 Jun 2015 22:41:30 -0700] rev 25584
parsers: add an API to create a new presized dict
Siddharth Agarwal <sid0@fb.com> [Mon, 15 Jun 2015 22:37:33 -0700] rev 25583
parsers: factor out code to create a presized dict
In upcoming patches we'll expose this as an API.
Siddharth Agarwal <sid0@fb.com> [Mon, 15 Jun 2015 22:29:29 -0700] rev 25582
parsers: drop Python 2.4 compat in make_file_foldmap
Augie Fackler <augie@google.com> [Tue, 16 Jun 2015 14:11:58 -0400] rev 25581
progress: respect ui.quiet (
issue4726)
Caught when I was running the hgsubversion testsuite and it started
printing progress bars over top of my test output lines.
Matt Mackall <mpm@selenic.com> [Mon, 15 Jun 2015 13:31:22 -0500] rev 25580
merge with stable
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 May 2015 13:22:48 -0700] rev 25579
match: don't remove '.' from _includeroots
This makes _includeroots more like _fileroots and gives visitdir() a
nice symmetry in the two.
I'm hoping to later combine the two (_fileroots and _includeroots),
and having them treated similarly should make that step easier to
follow.
Martin von Zweigbergk <martinvonz@google.com> [Sun, 31 May 2015 13:17:41 -0700] rev 25578
match: join two nested if-blocks
Instead of
if a:
if b:
return False
let's write it
if a and b:
return False
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 May 2015 11:47:55 -0700] rev 25577
match: drop optimization (?) of 'parentdirs' calculation
It seems unlikely that the optimization to avoid calling util.finddirs
twice will be noticeable, so let's drop it. This makes the two
conditions for includes and regular patterns more similar.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 May 2015 09:34:00 -0700] rev 25576
match: break boolean expressions into one operand per line
This makes it much easier to spot both the operators ('and'/'or') and
the operands.
Martin von Zweigbergk <martinvonz@google.com> [Wed, 27 May 2015 13:23:35 -0700] rev 25575
match: drop unnecessary removal of '.' from excluded roots
The repo root is nothing special when it comes to what directories to
visit: patterns like '-X relglob:*.py' should not exclude the top
directory, while '-X path:.' should (pointless as such a pattern may
be). The explicit removal of '.' from the set of excluded roots was
probably there to avoid removing the the root directory when any
patterns had been given, but since
20ad936ac5d2 (treemanifest: visit
directory 'foo' when given e.g. '-X foo/ba?', 2015-05-27), we only
exclude directories that should be completely excluded, so we no
longer need to special-case the root directory.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Jun 2015 11:00:50 -0700] rev 25574
changegroup: simplify by not reusing 'prog(ress)' instance
Just create a new instance of the 'prog' class for each step instead
of replacing its fields and resetting the counter.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 12 Jun 2015 10:54:10 -0700] rev 25573
changegroup: don't use 'repo' for non-repo 'self'
'repo' is a very confusing name to use for 'self', especially when
it's not a repo. Also drop repo.ui member (a.k.a. self.ui) now that
'self' doesn't shadow outer 'repo' variable.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jun 2015 21:51:57 -0400] rev 25572
subrepo: introduce hgsubrepo._getctx()
This code is already used in a couple of places, and will need to be used in
others where wdir() support is needed. Trying to get the wdir() revision stored
in self._substate[1] when creating the object in subrepo.subrepo() resulted in
breaking various status and diff tests. This is a far less invasive change.
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jun 2015 13:08:11 -0400] rev 25571
convert: apply the appropriate phases to the destination (
issue4165)
If the conversion doesn't change the hash, and the cset is public in the source,
it should be public in the destination. (This can happen if file remapping is
done that doesn't affect the initial commits.) This also propagates the secret
phase from the source, regardless of the hash, because presumably the content is
what is secret. Otherwise, the destination commit stays in the draft phase.
Maybe any draft cset with an unchanged hash should be changed to public, because
it has effectively been shared, but convert pretty strongly implies throwing
away (or at least readonly archiving) the source repo.
The change in the rollback output is because the name of the outer transaction
is now 'convert', which seems more accurate. Unfortunately, the memctx won't
indicate the hash prior to committing, so the proper phase can't be applied with
the commit.
The repo is already write locked in mercurial_sink.before().
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jun 2015 13:04:00 -0400] rev 25570
convert: always track the hg source revision in the internal commit object
This will be needed in the next patch to determine if phases need to be
adjusted. The insertion of the source revision in 'extras{}' is still
controlled by the config property.
Laurent Charignon <lcharignon@fb.com> [Sat, 13 Jun 2015 00:51:43 -0700] rev 25569
repoview: invalidate 'visible' filtered revisions when bookmarks change
Context: the result of computehidden, used to compute the 'visible' revisions
is cached. Its output can change when:
1) new obsolete commits are created
2) new bookmarks are created or deleted
3) new tags are created or deleted
4) the parents of the working copy change
We currently correctly invalidate the cache only in the case 1).
This patch fixes the second case (bookmarks) by invalidating the cache once
a bookmark is added or removed.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 12 Jun 2015 22:09:41 -0400] rev 25568
ui: flush stderr after printing a non-chained exception for Windows
There were consistent test failures in test-bad-extension.t, because Windows
buffers stderr when redirected to a file (per the comment in ui.write_err()).
That resulted in failures like this:
--- c:/Users/Matt/Projects/hg/tests/test-bad-extension.t
+++ c:/Users/Matt/Projects/hg/tests/test-bad-extension.t.err
@@ -23,11 +23,11 @@
Traceback (most recent call last):
Exception: bit bucket overflow
*** failed to import extension badext2: No module named badext2
- Traceback (most recent call last):
- ImportError: No module named badext2
hg help [-ec] [TOPIC]
show help for a given topic or a help overview
+ Traceback (most recent call last):
+ ImportError: No module named badext2
show traceback for ImportError of hgext.name if debug is set
(note that --debug option isn't applied yet when loading extensions)
Instead of inserting another flush immediately after the print, to go along with
the one recently added prior to the print (see
3ff4b07412ad), funnel the output
through ui.write_err(). The flush prior to printing the traceback only mentions
that stdout needs to be flushed, and only stderr needs to be flushed after
printing the traceback. ui.write_err() does both for us without needing to
redocument the quirky Windows behavior. It will also clear any progress bar.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 11 Jun 2015 19:02:24 -0700] rev 25567
revset: use parentsets.min in _children
As stated in the comment, using the smartset 'min' will give more opportunity to
be smart. It give a small but significant boost to the performance. Most of the
time is still spend doing the actual computation but at least we can scrap some
performance when it makes sense.
revset #0: roots(0:tip)
plain
0) 0.046600
1) 0.044109 94%
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 11 Jun 2015 11:42:46 -0700] rev 25566
revset: prefetch all attributes before loop in _revsbetween
Python is slow at attributes lookup. No, really, I mean -slow-. prefetching
these three methods give use a measurable performance boost.
revset #0: 0::tip
plain
0) 0.037655
1) 0.034290 91%
Pierre-Yves David <pierre-yves.david@logilab.fr> [Thu, 07 Feb 2013 00:32:26 +0000] rev 25565
hgweb: add some in-code documentation for 'web.view'
This documentation was mostly intended for the user helps. However given the
lack of request for such feature, we should keep it un-documented. We stick the
help text in the code as it could still be useful to fellow contributors.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 11 Jun 2015 17:19:48 -0700] rev 25564
bookmark: informs of failure to upgrade a bookmark
When we explicitly requested to update a bookmark but the bookmark location was
missing locally, we used to silently ignore the case. We now issue a message
about it to point that something wrong is going on.
By chance, we fixed all the cases where is case happened (for explicit pulling
only,
issue4700 is still open). But I think it is still valuable to have a
warning in place in case such issue is reintroduced.
This patch have been tested against
issue4689 test (but without
issue4689 fix).
It give the better but expected failure seen below:
> --- /home/pyd/src/mercurial-dev/tests/test-bookmarks-pushpull.t
> +++ /home/pyd/src/mercurial-dev/tests/test-bookmarks-pushpull.t.err
> @@ -337,12 +337,12 @@
> adding manifests
> adding file changes
> added 1 changesets with 1 changes to 1 files
> - updating bookmark Y
> + remote bookmark Y point to locally missing
0d60821d2197
> (run 'hg update' to get a working copy)
> $ hg book
> * @ 1:
0d2164f0ce0d
> X 1:
0d2164f0ce0d
> - Y 5:
35d1ef0a8d1b
> + Y 4:
b0a5eff05604
> Z 1:
0d2164f0ce0d
>
> Update a bookmark right after the initial lookup -r (
issue4700)
> @@ -387,12 +387,11 @@
> adding manifests
> adding file changes
> added 1 changesets with 1 changes to 1 files
> - updating bookmark Y
> (run 'hg update' to get a working copy)
> $ hg book
> * @ 1:
0d2164f0ce0d
> X 1:
0d2164f0ce0d
> - Y 6:
0d60821d2197
> + Y 4:
b0a5eff05604
> Z 1:
0d2164f0ce0d
> $ hg -R $TESTTMP/pull-race book
> @ 1:
0d2164f0ce0d
introom <i@introo.me> [Thu, 11 Jun 2015 08:54:24 -0400] rev 25563
fancyopts: allow all callable as default parameter value
The current fancyopts allows function as default parameter value
but not other callables.
By supporting other callables, we can have the benefits of e.g.,
custom __str__ method, which will be printed by 'hg help' as
the default value.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jun 2015 20:14:22 +0900] rev 25562
templater: evaluate arguments passed to diff() appropriately
Before this patch, diff() crashed by passing non-string expression because
it didn't evaluate arguments at all.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Jun 2015 14:43:59 -0700] rev 25561
parsers: do not cache RevlogError type (
issue4451)
Index lookups raise RevlogError when the lookup fails. The previous
implementation was caching a reference to the RevlogError type in a
static variable. This assumed that the "mercurial.error" module was
only loaded once and there was only a single copy of it floating
around in memory. Unfortunately, in some situations - including
certain mod_wsgi configurations - this was not the case: the
"mercurial.error" module could be reloaded. It was possible for a
"RevlogError" reference from the first interpreter to be used by
a second interpreter. While the underlying thing was a
"mercurial.error.RevlogError," the object IDs were different, so
the Python code in revlog.py was failing to catch the exception! This
error has existed since the C index lookup code was implemented in
changeset
e8d37b78acfb, which was first released in Mercurial 2.2 in
2012.
http://emptysqua.re/blog/python-c-extensions-and-mod-wsgi/#static-variables-are-shared
contains more details.
This patch removes the caching of the RevlogError type from the
function.
Since pretty much the entire function was refactored and the return
value of the function wasn't used, I changed the function signature
to not return anything.
For reasons unknown to me, we were calling PyErr_SetObject()
with the type of RevlogError and an instance of RevlogError. This
was equivalent to the Python code "raise RevlogError(RevlogError)".
This seemed wonky and completely unnecessary. The Python code only
cares about the type of the exception, not its contents. So I got
rid of this complexity.
This is my first Python C extension patch. Please give extra scrutiny
to it during review.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 12 Jun 2015 16:11:42 -0400] rev 25560
largefiles: restore the original converter class after lfconvert --to-normal
Not sure how much this really matters, but much of the largefiles code that
monkey-patches like this restores things when it finishes.
Pierre-Yves David <pierre-yves.david@fb.com> [Thu, 11 Jun 2015 13:02:21 -0700] rev 25559
push: only say we are trying to push obsmarkers when we actually try
The message was issued unconditionally. Move it inside the `if` that actually
tries to push obsmarkers.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 29 May 2015 13:25:34 -0400] rev 25558
convert: support incremental conversion with hg subrepos
This was implied in
issue3486, which specifically asked for subrepo support in
lfconvert. Now that lfconvert uses the convert extension internally when going
to normal files, the issue is half fixed. But now even non largefile repos
benefit when other transformations are needed.
Supporting a full subrepo tree conversion from a single command doesn't seem
reasonable, given the number of options that can be provided, and the
transformations that would need to occur when entering a subrepo (consider
'filemap' paths). Instead, this allows the user to incrementally convert each
hg subrepo from bottom up like so:
# so convert knows the dest type when it sees a non empty dest dir
$ hg init converted
$ hg convert orig/sub1 converted/sub1
$ hg convert orig/sub2 converted/sub2
$ hg convert orig converted
This allows different options to be applied to different subrepos more readily.
It assumes the shamap is in the default location in each converted subrepo for
simplicity. It also allows for a subrepo to be cloned into place, in case _it_
doesn't need a conversion. I was able to convert away from using
largefiles/bfiles in several subrepos with this mechanism.
Laurent Charignon <lcharignon@fb.com> [Fri, 05 Jun 2015 13:41:14 -0700] rev 25557
crecord: exit edition of hunk with non-zero status does not interrupt session
Before this patch, when editing a hunk, if the editor was exiting with a non-
zero status the crecord session would be aborted. This patch makes crecord
handle the failure and goes back to the state before the failed edition.
We use the new error reporting mechanism introduced in the previous patch to
notify the user of the issue.
Laurent Charignon <lcharignon@fb.com> [Fri, 05 Jun 2015 13:53:49 -0700] rev 25556
crecord: add mechanism for error reporting
Before this patch, there was no way to report errors in the crecord ui.
This patch introduces a new variable errorstr. If set, its content replaces the
top banner displayed in crecord until a key is pressed.
Laurent Charignon <lcharignon@fb.com> [Fri, 05 Jun 2015 13:32:52 -0700] rev 25555
crecord: extract ui refresh code after editing of hunk in a function
This is useful to reuse the logic to implement the continuation of the crecord
session if the user edits a hunk and the editor exits with a non-zero status.