Patchwork [3,of,6,RFC] localrepo: use the vfs join method to implement the localrepo join method

login
register
mail settings
Submitter Angel Ezquerra
Date Dec. 24, 2014, 12:05 p.m.
Message ID <3df32d91a2d02d2f7144.1419422726@108.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/7227/
State Superseded
Headers show

Comments

Angel Ezquerra - Dec. 24, 2014, 12:05 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1419360518 -3600
#      Tue Dec 23 19:48:38 2014 +0100
# Node ID 3df32d91a2d02d2f7144529e242d4f92544f4a28
# Parent  1664b472cc83f97257c7914c59bfa1600dc64f1a
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 altvfs" class introduced recently).

Note that we could have modified the VFS join methods to acept 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.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -765,7 +765,7 @@ 
         return None
 
     def join(self, f, *insidef):
-        return os.path.join(self.path, f, *insidef)
+        return self.vfs.join(os.path.join(f, *insidef))
 
     def wjoin(self, f, *insidef):
         return os.path.join(self.root, f, *insidef)