Angel Ezquerra <angel.ezquerra@gmail.com> [Sat, 28 Jun 2014 01:42:39 +0200] rev 21892
tags: introduce _readtaghist function
The existing _readtags function has been modified a little and renamed
_readtaghist. A new _readtaghist function has been added, which is a wrappger
around _readtaghist. Its output is the same as the old _readtaghist.
The purpose of this change is to make it possible to automatically merge tag
files. In order to do so we will need to get the line numbers for each of the
tag-node pairs on the first merge parent.
This is not used yet, but will be used on a follow up patch that will introduce
an automatic tag merge algorithm.
I performed some tests to compare the effect of this change. I used timeit to
run the test-tags.t test a 9 times with and without this patch. The results
were:
- without this patch: 3 loops, best of 3: 8.55 sec per loop
- with this patch: 3 loops, best of 3: 8.49 sec per loop
The the test was on average was slightly faster with this patch (although the
difference was probably not statistically significant).
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:42:35 +0900] rev 21891
subrepo: ensure "close()" execution at the end of "_initrepo()"
Before this patch, "close()" for the file object opened in
"_initrepo()" may not be executed, if unexpected exception is raised,
because it isn't executed in "finally" clause.
This patch ensures "close()" execution at the end of "_initrepo()" by
moving it into "finally" clause.
This patch puts configuration lines into "lines" array and write them
out at once, to narrow the scope of "try"/"finally" for review-ability.
This patch doesn't use "vfs.write()", because:
- current "vfs.write()" implementation doesn't take "mode" argument
to open file in "text" mode
- writing hgrc file out in binary mode may break backward compatibility
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:41:31 +0900] rev 21890
subrepo: add test whether "[paths]" is configured correctly at subrepo creation
This test is added for changes in the subsequent patch.
This test doesn't use "(glob)" for expected output, because "[paths]"
is configured at subrepo creation by "_abssource()" using
"posixpath.join()" to join path components.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:21:19 +0900] rev 21889
subrepo: ensure "close()" execution at the end of "_cachestorehash()"
Before this patch, "close()" for the file object opened in
"_cachestorehash()" may not be executed, if unexpected exception is
raised, because it isn't executed in "finally" clause.
This patch ensures "close()" execution at the end of
"_cachestorehash()" by moving it into "finally" clause.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:21:19 +0900] rev 21888
subrepo: ensure "close()" execution at the end of "_readstorehashcache()"
Before this patch, "close()" for the file object opened in
"_readstorehashcache()" may not be executed, if unexpected exception
is raised, because it isn't executed in "finally" clause.
This patch ensures "close()" execution at the end of
"_readstorehashcache()" by moving it into "finally" clause.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:21:19 +0900] rev 21887
subrepo: ensure "close()" execution at the end of "_calcfilehash()"
Before this patch, "close()" for the file object opened in
"_calcfilehash()" may not be executed, if unexpected exception is
raised, because it isn't executed in "finally" clause.
This patch ensures "close()" execution at the end of "_calcfilehash()"
by moving it into "finally" clause.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:21:19 +0900] rev 21886
subrepo: ensure "lock.release()" execution at the end of "_cachestorehash()"
Before this patch, "lock.release()" for "self._repo" in
"_cachestorehash()" of "hgsubrepo" may not be executed, if unexpected
exception is raised, because it isn't executed in "finally" clause.
This patch ensures "lock.release()" execution at the end of
"_cachestorehash()" by moving it into "finally" clause.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 20 Jun 2014 00:21:19 +0900] rev 21885
subrepo: ensure "lock.release()" execution at the end of "storeclean()"
Before this patch, "lock.release()" for "self._repo" in "storeclean()"
of "hgsubrepo" may not be executed, if unexpected exception is raised,
because it isn't executed in "finally" clause.
This patch ensures "lock.release()" execution at the end of
"storeclean()" by moving it into "finally" clause.
This patch chooses moving almost all lines in "storeclean()" into
"_storeclean()" instead of indenting them for "try/finally" clauses,
to keep diff simple for review-ability.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 07 Jul 2014 18:45:46 +0900] rev 21884
largefiles: confirm existence of outgoing largefile entities in remote store
Before this patch, "hg summary" and "hg outgoing" show and count up
all largefiles changed/added in outgoing revisions, even though some
of them are already uploaded into remote store.
This patch confirms existence of outgoing largefile entities in remote
store, to show and count up only really outgoing largefile entities at
"hg summary" and "hg outgoing".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 07 Jul 2014 18:45:46 +0900] rev 21883
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 07 Jul 2014 18:45:46 +0900] rev 21882
largefiles: show also how many data entities are outgoing at "hg summary"
Before this patch, "hg summary --large" shows how many largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the number of outgoing largefiles shown in
"hg summary" output, users should expect that the former below costs
much more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
summary" by counting number of unique hash values for outgoing
largefiles.
This patch introduces "_getoutgoings" to centralize the logic
(de-duplication, too) into it for convenience of subsequent patches,
even though it is not required in "hg summary" case.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 07 Jul 2014 18:45:46 +0900] rev 21881
largefiles: add tests for summary/outgoing improved in subsequent patches
This patch adds tests for summary/outgoing improved in subsequent
patches, to reduce amount of diffs in each patches.
This patch adds new revisions below:
- revision #2 adds new largefiles, but they contain as same data as
one already existing
this causes that multiple standins refer the same data entity
- revision #3, #4 and #5 change the already existing largefile
this causes that multiple data entities are outgoing for the standin.
#5 can be used to check de-duplication of "(hash, filename)" pair.
Siddharth Agarwal <sid0@fb.com> [Sat, 12 Jul 2014 17:59:03 -0700] rev 21880
context: generate filtered manifest efficiently for exact matchers
When the matcher is exact, there's no reason to iterate over the entire
manifest. It's much more efficient to iterate over the list of files instead.
For a repository with approximately 300,000 files, this speeds up
hg log -l10 --patch --follow for a frequently modified file from 16.5 seconds
to 10.5 seconds.
Siddharth Agarwal <sid0@fb.com> [Sat, 12 Jul 2014 17:57:25 -0700] rev 21879
manifestdict: add a new method to intersect with a set of files
This is meant to be used when the set of files is known in advance, e.g. with a
match object with no patterns.
Siddharth Agarwal <sid0@fb.com> [Sat, 12 Jul 2014 18:31:18 -0700] rev 21878
log: use an exact matcher for --patch --follow
The arguments to log --patch --follow are expected to be exact paths.
This will be used to make manifest filtering for these cases more efficient in
upcoming patches.
Matt Mackall <mpm@selenic.com> [Wed, 16 Jul 2014 17:35:04 -0500] rev 21877
merge with stable
Siddharth Agarwal <sid0@fb.com> [Sat, 12 Jul 2014 02:23:17 -0700] rev 21876
log: make --patch --follow work inside a subdirectory
Previously, the 'patch' code for hg log --patch --follow would try to resolve
patterns relative to the repository root rather than the current working
directory. Fix that by using match.files instead of pats, as done elsewhere
nearby.
Yuya Nishihara <yuya@tcha.org> [Sat, 12 Jul 2014 20:07:24 +0900] rev 21875
mergetools: add --nofork option to gvimdiff.diffargs for extdiff
Without --nofork, temporary files are removed immediately before gvimdiff
starts. "-d -g -O" are put just for consistency with gvimdiff.args.
anatoly techtonik <techtonik@gmail.com> [Sat, 05 Jul 2014 16:32:28 +0300] rev 21874
contrib/vagrant: use Vagrant for running tests on virtual machine
$ cd contrib/vagrant
$ vagrant up
$ vagrant ssh -c ./run-tests.sh
Repository is shared at /hgshared in guest machine.
Matt Mackall <mpm@selenic.com> [Mon, 14 Jul 2014 18:53:03 -0500] rev 21873
merge with stable
Siddharth Agarwal <sid0@fb.com> [Sat, 12 Jul 2014 20:44:00 -0700] rev 21872
log: allow revset for --follow to be lazily evaluated
It is unclear to me why evaluation was forced.
For a repository with over 700,000 commits, 'hg log -f' drops from 1.2 seconds
to 0.2 seconds.
Siddharth Agarwal <sid0@fb.com> [Mon, 14 Jul 2014 15:42:31 -0700] rev 21871
parsers: remove unused getintat function
Warning detected by clang.
Matt Mackall <mpm@selenic.com> [Mon, 14 Jul 2014 17:55:31 -0500] rev 21870
revset: maintain ordering when subtracting from a baseset (
issue4289)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 15 Jul 2014 00:59:09 +0900] rev 21869
cmdutil: separate building commit text from 'commitforceeditor'
This separation makes it easier to extend/hook building commit text
from the specified context.
This patch uses 'committext' instead of 'edittext' for names of newly
added variable and function, because the former is more purpose
specific than the latter, even though 'edittext' in 'buildcommittext'
is left as it is to reduce amount of diff.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 14 Jul 2014 23:33:59 +0900] rev 21868
convert: detect removal of ".gitmodules" at git source revisions correctly
Before this patch, all operations applied on ".gitmodules" at git
source revisions are treated as modification, even if they are
actually removal of it.
If removal of ".gitmodules" is treated as modification unexpectedly,
"hg convert" is aborted by the exception raised in
"retrievegitmodules()" for ".gitmodules" at the git source revision
removing it, because that revision doesn't have any information of
".gitmodules".
This patch detects removal of ".gitmodules" at git source revisions
correctly.
If ".gitmodules" is removed at the git source revision, this patch
records "hex(nullid)" as the contents hash value for ".hgsub" and
".hgsubstate" at the destination revision.
This patch makes "getfile()" raise IOError also for ".hgstatus" and
".hgsubstate" if the contents hash value is "hex(nullid)", and this
tells removal of ".hgstatus" and ".hgsubstate" at the destination
revision to "localrepository.commitctx()" correctly.
For files other than ".hgstatus" and ".hgsubstate", checking the
contents hash value in "getfile()" may be redundant, because
"catfile()" for them also does so.
But this patch chooses writing it only once at the beginning of
"getfile()", to avoid writing same code twice both for ".hgsub" and
".hgsubstate" separately.
Matt Mackall <mpm@selenic.com> [Mon, 14 Jul 2014 12:44:45 -0500] rev 21867
templates: escape NUL bytes in jsonescape (
issue4303)
It's currently possible for various fields to contain NUL bytes, which
are disallowed in JSON.
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 12 Jul 2014 10:52:58 -0700] rev 21866
localrepo: document localrepo.hook()
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sun, 06 Jul 2014 02:56:41 +0900] rev 21865
filemerge: use 'util.ellipsis' to trim custom conflict markers correctly
Before this patch, filemerge slices byte sequence directly to trim
conflict markers, but this may cause:
- splitting at intermediate multi-byte sequence
- incorrect calculation of column width (length of byte sequence is
different from columns in display in many cases)
This patch uses 'util.ellipsis' to trim custom conflict markers
correctly, even if multi-byte characters are used in them.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sun, 06 Jul 2014 02:56:41 +0900] rev 21864
filemerge: use only the first line of the generated conflict marker for safety
Before this patch, with careless configuration (missing '|firstline'
filtering for '{desc}' keyword, for example), '[ui]
mergemarkertemplate' can make conflict markers multiple lines.
For ordinary users, advantage of allowing '[ui] mergemarkertemplate'
to generate multiple lines for customizing seems to be less than
advantage of disallowing it for safety.
This patch uses only the first line of the conflict marker generated
from '[ui] mergemarkertemplate' configuration for safety.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sun, 06 Jul 2014 02:56:41 +0900] rev 21863
progress: use 'encoding.colwidth' to get column width of items correctly
Before this patch, 'progress' extension applies 'len' on byte sequence
to get column width of it, but it causes incorrect result, when length
of byte sequence and columns in display are different from each other
in multi-byte characters.
This patch uses 'encoding.colwidth' to get column width of items in
output line correctly, even if it contains multi-byte characters.