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.
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip