Tue, 09 Oct 2012 01:41:55 +0900 store: replace invocation of "getsize()" by "vfs.stat()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17727
store: replace invocation of "getsize()" by "vfs.stat()" This patch replaces invocation of "getsize()", which calls "os.stat()" internally, by "vfs.stat()". The object referred by "self.rawvfs" is used internally by "_fncachevfs" and doesn't encode filename for each file API invocation. This patch invokes "os.stat()" via "self.rawvfs" to avoid redundant filename encoding: invocation of "os.stat()" via "self.vfs" hides filename encoding and encoding result from caller, so it is not appropriate, when both encoded and non-encoded filenames should be yield. Even though changeset b42b0729744d improved stream_out performance by "self.pathsep + path", this patch replaces it by "os.path.join(self.base, path)" of vfs. So, this may increase cost to join path components. But this shouldn't have large impact, because: - such cost is much less than cost of "os.stat()" which causes system call invocation - "datafiles()" of store object is invoked only for "hg manifest --all" or "hg verify" which are both heavy functions
Tue, 09 Oct 2012 01:41:55 +0900 store: invoke "os.stat()" for "createmode" initialization via vfs
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17726
store: invoke "os.stat()" for "createmode" initialization via vfs This just replaces "os.stat()" invocation: refactoring around "self.createmode" and "vfs.createmode" initialization is omitted. This patch also newly adds "stat()" function to "abstractvfs".
Tue, 09 Oct 2012 01:41:55 +0900 vfs: define "join()" in each classes derived from "abstractvfs"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17725
vfs: define "join()" in each classes derived from "abstractvfs" This patch defines "join()" in each classes derived from "abstractvfs" except "vfs", which already defines it. This allows all vfs instances to be used for indirect file API invocation.
Tue, 09 Oct 2012 01:41:55 +0900 store: initialize vfs field first to use it for initialization of others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17724
store: initialize vfs field first to use it for initialization of others This patch initializes "vfs" field in the constructor of each store classes to use it for initialization of others. In this patch, "self.vfs.base" is used to initialize "self.path", because redo join of path components for "self.path" is redundant.
Tue, 09 Oct 2012 01:41:55 +0900 scmutil: reorder newly added functions for vfs support in dictionary order
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17723
scmutil: reorder newly added functions for vfs support in dictionary order Definition functions for vfs support in dictionary order increases readability/maintainability, because there are functions which invoke file API: - with same name: "os.listdir" and "osutil.listdir", for example - with ambiguous names: "os.mkdir" and "util.makedirs", for example
Tue, 09 Oct 2012 01:41:55 +0900 store: rename field name from "opener" to "vfs" in internal classes for fncache
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17722
store: rename field name from "opener" to "vfs" in internal classes for fncache These fields are used only in store module, so keeping "self.opener" for backward compatibility like as "localrepository" class is not needed.
Tue, 09 Oct 2012 01:41:55 +0900 store: rename argument name from "op"(ener) to "vfs"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Tue, 09 Oct 2012 01:41:55 +0900] rev 17721
store: rename argument name from "op"(ener) to "vfs"
Thu, 04 Oct 2012 01:24:05 +0900 verify: rename "hasmanifest" variable for source code readability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 04 Oct 2012 01:24:05 +0900] rev 17720
verify: rename "hasmanifest" variable for source code readability Before this patch, there are two ambiguous variables: "havemf" and "hasmanifest". "havemf" means whether there are any "manifest" entries. "hasmanifest" means whether there are any "changelog" entries referring to "manifest" entry. This patch renames from "hasmanifest" to "refersmf" to clear difference from "havemf".
Thu, 04 Oct 2012 01:24:05 +0900 verify: use appropriate local variable in "checkentry()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 04 Oct 2012 01:24:05 +0900] rev 17719
verify: use appropriate local variable in "checkentry()" Before this patch, "checkentry()" internal function uses both "node"(argument of itself) and "n"(defined in outer of it) variables. Because all callers of "checkentry()" use "n" to refer the object which is passed to "checkentry()" as "node", both can refer same object in "checkentry()". So, "checkentry()" works correctly. But such usage is not good for independence of "checkentry()". This patch replaces "n" in "checkentry()" with "node".
Thu, 04 Oct 2012 01:24:05 +0900 verify: use appropriate node information to show verification error
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Thu, 04 Oct 2012 01:24:05 +0900] rev 17718
verify: use appropriate node information to show verification error Before this patch, verify module shows verification error message below: unknown parent 2 <HASH_OF_P2> of <HASH_OF_P1> even though it should show: unknown parent 2 <HASH_OF_P2> of <HASH_OF_TARGET> This patch uses appropriate node information.
(0) -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 +30000 tip