[PATCH] localrepo: make it possible to pass multiple path elements to join and wjoin

Angel Ezquerra angel.ezquerra at gmail.com
Fri Aug 29 10:13:43 CDT 2014


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at gmail.com>
# Date 1409239385 -7200
#      Thu Aug 28 17:23:05 2014 +0200
# Node ID 1ab777ff5c4d58772ad6d849e6d94be1e4314515
# Parent  bdc0e04df243d3995c7266bf7d138fddd0449ba6
localrepo: make it possible to pass multiple path elements to join and wjoin

This makes join and wjoin behave in the same way as os.path.join. That is, it
makes it possible to pass more than one path element to them.

Note that the first path element is still required, as it was before this patch,
and as is the case for os.path.join.

diff -r bdc0e04df243 -r 1ab777ff5c4d mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Aug 27 18:35:34 2014 +0200
+++ b/mercurial/localrepo.py	Thu Aug 28 17:23:05 2014 +0200
@@ -745,11 +745,11 @@
         # if publishing we can't copy if there is filtered content
         return not self.filtered('visible').changelog.filteredrevs
 
-    def join(self, f):
-        return os.path.join(self.path, f)
+    def join(self, f, *insidef):
+        return os.path.join(self.path, f, *insidef)
 
-    def wjoin(self, f):
-        return os.path.join(self.root, f)
+    def wjoin(self, f, *insidef):
+        return os.path.join(self.root, f, *insidef)
 
     def file(self, f):
         if f[0] == '/':


More information about the Mercurial-devel mailing list