[PATCH 1 of 2] localrepo: use the vfs join method to implement the localrepo join method

Angel Ezquerra angel.ezquerra at gmail.com
Fri Jan 2 12:31:00 UTC 2015


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1419360518 -3600
#      Tue Dec 23 19:48:38 2014 +0100
# Node ID 2c2eadf76e8b8dbb3abb265e87f41252cb1cdacb
# Parent  67d63ec85eb72187508692e52f14be46101707a5
localrepo: use the vfs join method to implement the localrepo join method

This will make it possible to customize the behavior of the join method by
changing the vfs class (e.g. by using the recently introduced "unionvfs" class).

Note that we could have modified the VFS join methods to accept a set of
optional paths in the same way thta the localrepo join method does. However it
seemed simpler to simply call os.path.join before calling self.vfs.join.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -759,7 +759,7 @@
         return not self.filtered('visible').changelog.filteredrevs
 
     def join(self, f, *insidef):
-        return os.path.join(self.path, f, *insidef)
+        return self.vfs.join(self.vfs.reljoin(f, *insidef))
 
     def wjoin(self, f, *insidef):
         return os.path.join(self.root, f, *insidef)


More information about the Mercurial-devel mailing list