Wed, 19 Nov 2014 18:35:14 +0900 subrepo: replace direct file APIs around "writelines" by "vfs.writelines"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23372
subrepo: replace direct file APIs around "writelines" by "vfs.writelines" This patch also replaces "self._getstorehashcachepath" (building absolute path up) by "self._getstorehashcachename" (building relative path up), because "vfs.writelines" requires relative path.
Wed, 19 Nov 2014 18:35:14 +0900 vfs: add "writelines"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23371
vfs: add "writelines" This patch allows "writelines" to take "mode" and "notindexed" arguments, because subsequent patch for subrepo requires both.
Wed, 19 Nov 2014 18:35:14 +0900 vfs: add "notindexed" argument to invoke "ensuredir" with it in write mode
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23370
vfs: add "notindexed" argument to invoke "ensuredir" with it in write mode This patch uses "False" as default value of "notindexed" argument, even though "vfs.makedir()" uses "True" for it, because "os.mkdir()" doesn't set "_FILE_ATTRIBUTE_NOT_CONTENT_INDEXED" attribute to newly created directories.
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: replace direct file APIs around "readlines" by "vfs.tryreadlines"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23369
subrepo: replace direct file APIs around "readlines" by "vfs.tryreadlines" This patch also replaces "self._getstorehashcachepath" (building absolute path up) by "self._getstorehashcachename" (building relative path up), because "vfs.tryreadlines" requires relative path. This patch makes "_readstorehashcache()" return "[]" (returned by "vfs.tryreadlines()"), when cache file doesn't exist, even though "_readstorehashcache()" returned '' (empty string) in such case before this patch. "_readstorehashcache()" is invoked only by the code path below in "_storeclean()": for filehash in self._readstorehashcache(path): if filehash != itercache.next(): clean = False break In this case, "[]" and '' don't differ from each other, because both of them cause avoiding iteration of "for loop".
Wed, 19 Nov 2014 18:35:14 +0900 vfs: add "readlines" and "tryreadlines"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23368
vfs: add "readlines" and "tryreadlines" This patch allows "readlines" and "tryreadlines" to take "mode" argument, because "subrepo" requires to read files not in "rb" (binary, default for vfs) but in "r" (text) mode in subsequent patch.
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: add "_cachestorehashvfs" to handle cache store hash files via vfs
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23367
subrepo: add "_cachestorehashvfs" to handle cache store hash files via vfs This "vfs" object will be used by subsequent patches to handle cache store hash files without direct file APIs. This patch decorates "_cachestorehashvfs" with "@propertycache" to delay vfs creation, because it is used only for cooperation with other repositories. In this patch, "/" is used as the path separator, even though "self._repo.join" uses platform specific path separator (e.g. "\\" on Windows). But it is reasonable enough, because "store" and other management file handling already include such implementation, and they work well.
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: remove "_calcfilehash" referred by no other code paths
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23366
subrepo: remove "_calcfilehash" referred by no other code paths
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: replace "_calcfilehash" invocation by "vfs.tryread"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23365
subrepo: replace "_calcfilehash" invocation by "vfs.tryread" "_calcfilehash" can be completely replaced by simple "vfs.tryread" invocation. def _calcfilehash(filename): data = '' if os.path.exists(filename): fd = open(filename, 'rb') data = fd.read() fd.close() return util.sha1(data).hexdigest() Building absolute path "absname" up by "self._repo.join" for files in "filelist" is avoided, because "vfs.tryread" does so internally.
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: replace "os.path.exists" by "exists" via wvfs of the parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23364
subrepo: replace "os.path.exists" by "exists" via wvfs of the parent Existance of specified "path" should be examined by "exists" via wvfs of the parent repository, because the working directory of the parent repository may be in UTF-8 mode. Wide API should be used via wvfs in such case. In this patch, "/" is used as the path separator, even though "path" uses platform specific path separator (e.g. "\\" on Windows). But it is reasonable enough, because "store" and other management file handling already include such implementation, and they work well.
Wed, 19 Nov 2014 18:35:14 +0900 subrepo: avoid redundant "util.makedirs" invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Wed, 19 Nov 2014 18:35:14 +0900] rev 23363
subrepo: avoid redundant "util.makedirs" invocation "util.makedirs" for the (sub-)repository root of "hgsubrepo" is also executed in the constructor of "localrepository", if "create" is True and ".hg" of it doesn't exist. This patch avoids redundant "util.makedirs" invocation in the constructor of "hgsubrepo".
Wed, 19 Nov 2014 08:50:08 -0800 merge: remove confusing comment about --force
Martin von Zweigbergk <martinvonz@google.com> [Wed, 19 Nov 2014 08:50:08 -0800] rev 23362
merge: remove confusing comment about --force manifestmerge() has a piece of code that's roughly: if not force and different: abort else: # if different: old untracked f may be overwritten and lost ... The comment only talks about what happens when 'different' is true, and in combination with the if-block above, that must mean that it is only about what happens when 'force and different'. It seems quite fine that files are overwritten when 'force' is true, so let's remove the comment. As it stands, it can easily be interpreted as a TODO (which is how I interpreted it at first).
Fri, 17 Oct 2014 22:23:06 -0700 phases: read pending data when appropriate
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 17 Oct 2014 22:23:06 -0700] rev 23361
phases: read pending data when appropriate If we are called by a hook and pending data exists, read those.
Sun, 28 Sep 2014 21:27:48 -0700 bookmark: read pending data when appropriate
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 28 Sep 2014 21:27:48 -0700] rev 23360
bookmark: read pending data when appropriate If we are called by a hook and pending data exists, read it.
Wed, 12 Nov 2014 16:54:57 +0000 test-bundle2: check visible data in pre/post-transaction hooks
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 12 Nov 2014 16:54:57 +0000] rev 23359
test-bundle2: check visible data in pre/post-transaction hooks We are about to make bookmarks and phases available for hooks. Therefore we need a witness for this new availability. We introduce the new hooks in a distinct changeset to reduce the noise in the ones with actual changes.
Fri, 17 Oct 2014 22:19:05 -0700 transaction: write pending generated files
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 17 Oct 2014 22:19:05 -0700] rev 23358
transaction: write pending generated files Such file are generated with a .pending prefix. It is up to the reader to implement the necessary logic for reading pending files. We add a test to ensure pending files are properly cleaned-up in both success and error cases.
Fri, 17 Oct 2014 21:57:32 -0700 transaction: have _generatefile return a boolean
Pierre-Yves David <pierre-yves.david@fb.com> [Fri, 17 Oct 2014 21:57:32 -0700] rev 23357
transaction: have _generatefile return a boolean The function returns True if any files were generated. This will be used to know if any pending files have been written.
Mon, 29 Sep 2014 01:29:08 -0700 transaction: allow generating files with a suffix
Pierre-Yves David <pierre-yves.david@fb.com> [Mon, 29 Sep 2014 01:29:08 -0700] rev 23356
transaction: allow generating files with a suffix This will allow us to generate temporary pending files. Files generated with a suffix are assumed temporary and will be cleaned up at the end of the transaction.
Wed, 19 Nov 2014 09:52:05 -0600 transaction: fix some docstring grammar
Matt Mackall <mpm@selenic.com> [Wed, 19 Nov 2014 09:52:05 -0600] rev 23355
transaction: fix some docstring grammar
Wed, 12 Nov 2014 14:57:41 +0000 transaction: accept a 'location' argument for registertmp
Pierre-Yves David <pierre-yves.david@fb.com> [Wed, 12 Nov 2014 14:57:41 +0000] rev 23354
transaction: accept a 'location' argument for registertmp This will allow generation of temporary files outside of store. This will be useful for bookmarks.
Tue, 18 Nov 2014 23:51:58 -0500 tests: handle differences between missing file error strings on Windows and Unix
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Nov 2014 23:51:58 -0500] rev 23353
tests: handle differences between missing file error strings on Windows and Unix
Tue, 18 Nov 2014 22:02:00 -0500 run-tests: don't warn on unnecessary globs mandated by check-code.py
Matt Harbison <matt_harbison@yahoo.com> [Tue, 18 Nov 2014 22:02:00 -0500] rev 23352
run-tests: don't warn on unnecessary globs mandated by check-code.py When test output is processed, if os.altsep is defined (i.e. on Windows), TTest.globmatch() will cause a warning later on if a line has a glob that isn't necessary. Unfortunately, the regex checking in check-code.py doesn't have this context. Therefore we ended up with cases where the test would get flagged with a warning only on Windows because a glob was present, because check-code.py would warn if it wasn't. For example, from test-subrepo.t: $ hg -R issue1852a push `pwd`/issue1852c pushing to $TESTTMP/issue1852c (glob) The glob isn't necessary here because the slash is shown as it was provided. However, check-code mandates one to handle the case where the default path has backslashes in it. Break the cycle by checking against a subset of the check-code rules before flagging the test with a warning, and ignore the superfluous glob if it matches a rule. This change fixes warnings in test-largefiles-update.t, test-subrepo.t, test-tag.t, and test-rename-dir-merge.t on Windows. I really hate that the rules are copy/pasted here (minus the leading two spaces) because it would be nice to only update the rules once, in a single place. But I'm not sure how else to do it. I'm open to suggestions. Splitting some of the rules out of check-code.py seems wrong, but so does moving check-code.py out of contrib, given that other checking scripts live there. There are other glob patterns that could be copied over, but this is enough to make the current tests run on Windows.
Tue, 18 Nov 2014 16:14:32 -0800 update: remove unnecessary check for unknown files with --check
Martin von Zweigbergk <martinvonz@google.com> [Tue, 18 Nov 2014 16:14:32 -0800] rev 23351
update: remove unnecessary check for unknown files with --check As far as I and the test suite can tell, the checks in manifestmerge() already report the errors (whether or not --check is given), so we don't need to call merge.checkunknown(). Since this is the last call to the method, also remove the method.
Tue, 18 Nov 2014 12:29:30 -0600 merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 18 Nov 2014 12:29:30 -0600] rev 23350
merge with stable
Sun, 16 Nov 2014 22:03:57 -0500 tests: move a multi-statement debuglocks hook into a shell script for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sun, 16 Nov 2014 22:03:57 -0500] rev 23349
tests: move a multi-statement debuglocks hook into a shell script for Windows Before this patch, a part of "test-push-hook-lock.t" fails unexpectedly on Windows environment, because semicolon (";") isn't recognized as the command separator by "cmd.exe". This is fixed the same way as a similar issue in 7c253c23de3b.
Sun, 16 Nov 2014 16:26:15 -0500 tests: fix globs for Windows
Matt Harbison <matt_harbison@yahoo.com> [Sun, 16 Nov 2014 16:26:15 -0500] rev 23348
tests: fix globs for Windows test-largefiles-update.t, test-subrepo.t, test-tag.t, and test-rename-dir-merge.t still warn about no result returned because of unnecessary globs that test-check-code-hg.t wants, relating to output for pushing to, pulling from and moving X to Y.
Tue, 04 Nov 2014 12:46:00 -0500 run-tests: include quotes in the HGEDITOR value when storing sys.executable
Matt Harbison <matt_harbison@yahoo.com> [Tue, 04 Nov 2014 12:46:00 -0500] rev 23347
run-tests: include quotes in the HGEDITOR value when storing sys.executable This fixes test-install.t on Windows that broke in 2122b82b6987 when shlex.split() was added to the debuginstall command: @@ -7,8 +7,11 @@ checking installed modules (*mercurial)... (glob) checking templates (*mercurial?templates)... (glob) checking commit editor... + Can't find editor 'c:\Python27\python.exe -c "(omitted)"' in PATH + (specify a commit editor in your configuration file) checking username... - no problems detected + 1 problems detected, please check your install! + [1] What happens is that shlex.split() on Windows turns this: c:\Python27\python.exe -c "import sys; sys.exit(0)" into this: ['c:Python27python.exe', '-c', 'import sys; sys.exit(0)'] While technically a regression, most programs on Windows live in some flavor of 'Program Files', and therefore the environment variable needs to contain quotes anyway to handle the space. This wasn't handled prior to the shlex() change, because it tested the whole environment variable to see if it was an executable, or split on the first space and tested again.
Mon, 17 Nov 2014 01:48:43 +0100 mq: when adding headers in plain mode, separate them from message (issue4453) stable
Mads Kiilerich <madski@unity3d.com> [Mon, 17 Nov 2014 01:48:43 +0100] rev 23346
mq: when adding headers in plain mode, separate them from message (issue4453) c87f2a5a6e49 did a clean-up in one direction ... but we want it in the other direction.
Mon, 17 Nov 2014 01:48:19 +0100 mq: introduce insertplainheader - same naive implementation as before stable
Mads Kiilerich <madski@unity3d.com> [Mon, 17 Nov 2014 01:48:19 +0100] rev 23345
mq: introduce insertplainheader - same naive implementation as before
Sun, 16 Nov 2014 19:57:40 +0100 mq: when setting message in plain mode, separate it from header (issue4453) stable
Mads Kiilerich <madski@unity3d.com> [Sun, 16 Nov 2014 19:57:40 +0100] rev 23344
mq: when setting message in plain mode, separate it from header (issue4453) Fix inconsistent handling of plain header separation in mq patcheader - and contrary to c87f2a5a6e49, do it in the direction of having an empty line between header and description. Plain patches are like mails and should thus have an empty line between headers and body in compliance with RFC 822 3.1.
Sun, 16 Nov 2014 00:40:29 -0800 setdiscovery: avoid a full changelog graph traversal
Siddharth Agarwal <sid0@fb.com> [Sun, 16 Nov 2014 00:40:29 -0800] rev 23343
setdiscovery: avoid a full changelog graph traversal We were definitely being suboptimal here: we were constructing two full sets, one with the full set of common nodes (i.e. a graph traversal) and one with all nodes. Then we subtract one set from the other. This whole process is O(commits) and causes discovery to be significantly slower than it should be. Instead, keep track of common incrementally and keep undecided as small as possible. This makes discovery massively faster on large repos: on one such repo, 'hg debugdiscovery' over SSH with one commit missing on the client and five on the server went from 4.5 seconds to 1.5. (An 'hg debugdiscovery' with no commits missing on the client, i.e. connection startup time, was 1.2 seconds.)
Fri, 14 Nov 2014 19:40:30 -0800 ancestor: add a way to remove ancestors of bases from a given set
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 19:40:30 -0800] rev 23342
ancestor: add a way to remove ancestors of bases from a given set This and missingancestors can share state, which will turn out to be perfect for set discovery.
Fri, 14 Nov 2014 17:21:00 -0800 ancestor: add a way to add to bases of a missing ancestor object
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 17:21:00 -0800] rev 23341
ancestor: add a way to add to bases of a missing ancestor object This will be useful for setdiscovery, since with that we incrementally add to our knowledge of common nodes.
Sun, 16 Nov 2014 00:39:29 -0800 ancestor: add a way to test whether a missing ancestor object has bases
Siddharth Agarwal <sid0@fb.com> [Sun, 16 Nov 2014 00:39:29 -0800] rev 23340
ancestor: add a way to test whether a missing ancestor object has bases This is pretty trivial so there's no unit test coverage for it. This will be used by setdiscovery.
Fri, 14 Nov 2014 16:53:40 -0800 ancestor: remove now-unused missingancestors function
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 16:53:40 -0800] rev 23339
ancestor: remove now-unused missingancestors function Callers should use revlog.incrementalmissingrevs instead.
Fri, 14 Nov 2014 16:52:40 -0800 revlog: switch findmissing* methods to incrementalmissingrevs
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 16:52:40 -0800] rev 23338
revlog: switch findmissing* methods to incrementalmissingrevs This will allow us to remove ancestor.missingancestors in an upcoming patch.
Sun, 16 Nov 2014 00:39:48 -0800 revlog: add a method to get missing revs incrementally
Siddharth Agarwal <sid0@fb.com> [Sun, 16 Nov 2014 00:39:48 -0800] rev 23337
revlog: add a method to get missing revs incrementally This will turn out to be useful for discovery.
Sat, 15 Nov 2014 19:26:20 -0800 test-ancestor: add support for multiple tests against one incremental object
Siddharth Agarwal <sid0@fb.com> [Sat, 15 Nov 2014 19:26:20 -0800] rev 23336
test-ancestor: add support for multiple tests against one incremental object In upcoming patches we'll add more operations to the object, and this prepares for testing those operations.
Fri, 14 Nov 2014 23:50:01 -0800 test-ancestor: move naive missing ancestor algorithm into a class
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 23:50:01 -0800] rev 23335
test-ancestor: move naive missing ancestor algorithm into a class This mirrors the change to the real missing ancestor algorithm in a previous patch.
Fri, 14 Nov 2014 23:44:38 -0800 ancestor.missingancestors: turn into a state-keeping class
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 23:44:38 -0800] rev 23334
ancestor.missingancestors: turn into a state-keeping class This allows multiple efficient missing ancestor queries against the same set of bases. In upcoming patches we'll also define ways to grow the set of bases. The fact that the test output hasn't changed establishes this patch's correctness.
Fri, 14 Nov 2014 13:47:25 -0800 ancestor.missingancestors: calculate start point after filtering revsvisit
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 13:47:25 -0800] rev 23333
ancestor.missingancestors: calculate start point after filtering revsvisit Any revs that are filtered out are also in basesvisit, which means they wouldn't be returned in the missing list anyway. There's no need to explore such revs or their ancestors. The 'if not revsvisit' check moves down because we can't call max() on an empty set.
Fri, 14 Nov 2014 11:33:52 -0800 ancestor.missingancestors: don't discard from basesvisit
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 11:33:52 -0800] rev 23332
ancestor.missingancestors: don't discard from basesvisit We only actually care about whether revsvisit is empty, so we can let basesvisit grow to arbitrary size. It turns out that this actually helps performance. For a large repo with hundreds of thousands of commits, hg perfrevset 'only(0, tip)' (basically the worst case, involving a full DAG traversal) goes from 1.63 seconds to 1.50. hg perfrevset 'only(tip, 0)' remains unchanged at 1.98 seconds.
Sat, 15 Nov 2014 10:55:34 -0800 test-ancestor: use random testing for missing ancestors
Siddharth Agarwal <sid0@fb.com> [Sat, 15 Nov 2014 10:55:34 -0800] rev 23331
test-ancestor: use random testing for missing ancestors We're going to make changes to the missing ancestor algorithm, and random testing will give us much more confidence than a fixed set of tests.
Sat, 15 Nov 2014 18:52:44 -0800 test-ancestor: define a main function
Siddharth Agarwal <sid0@fb.com> [Sat, 15 Nov 2014 18:52:44 -0800] rev 23330
test-ancestor: define a main function We're going to add to it in upcoming patches.
Fri, 14 Nov 2014 14:50:03 -0800 test-ancestor: test iteration for lazyancestors
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 14:50:03 -0800] rev 23329
test-ancestor: test iteration for lazyancestors This has some test coverage in test-revlog-ancestry.py, but not very much.
Fri, 14 Nov 2014 14:36:25 -0800 ancestor.lazyancestors: take parentrevs function rather than changelog
Siddharth Agarwal <sid0@fb.com> [Fri, 14 Nov 2014 14:36:25 -0800] rev 23328
ancestor.lazyancestors: take parentrevs function rather than changelog Principle of least privilege, and it also brings this in line with missingancestors.
Sun, 16 Nov 2014 00:24:23 -0500 remove: avoid a bogus warning about no tracked files when removing '.'
Matt Harbison <matt_harbison@yahoo.com> [Sun, 16 Nov 2014 00:24:23 -0500] rev 23327
remove: avoid a bogus warning about no tracked files when removing '.' Previously, any files relative to the root of the repo that match the -I patterns would be deleted, but the command exited with 1 after printing a warning: $ hg remove -S -I 're:.*.txt' . removing sub1/sub2/folder/test.txt removing sub1/sub2/test.txt not removing .: no tracked files
Wed, 12 Nov 2014 23:15:20 -0500 remove: support remove with explicit paths in subrepos
Matt Harbison <matt_harbison@yahoo.com> [Wed, 12 Nov 2014 23:15:20 -0500] rev 23326
remove: support remove with explicit paths in subrepos
Sat, 15 Nov 2014 21:36:19 -0500 remove: recurse into subrepositories with --subrepos/-S flag
Matt Harbison <matt_harbison@yahoo.com> [Sat, 15 Nov 2014 21:36:19 -0500] rev 23325
remove: recurse into subrepositories with --subrepos/-S flag Like 'forget', git and svn subrepos are currently not supported. Unfortunately the name 'remove' is already used in the subrepo classes, so we break the convention of naming the subrepo function after the command.
(0) -10000 -3000 -1000 -300 -100 -48 +48 +100 +300 +1000 +3000 +10000 tip