comparison mercurial/localrepo.py @ 22362:c9b32c6a2944

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.
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Thu, 28 Aug 2014 17:23:05 +0200
parents 262c5cc126c1
children 12bc7f06fc41
comparison
equal deleted inserted replaced
22361:eb6adf750954 22362:c9b32c6a2944
737 if not self.ui.configbool('phases', 'publish', True): 737 if not self.ui.configbool('phases', 'publish', True):
738 return True 738 return True
739 # if publishing we can't copy if there is filtered content 739 # if publishing we can't copy if there is filtered content
740 return not self.filtered('visible').changelog.filteredrevs 740 return not self.filtered('visible').changelog.filteredrevs
741 741
742 def join(self, f): 742 def join(self, f, *insidef):
743 return os.path.join(self.path, f) 743 return os.path.join(self.path, f, *insidef)
744 744
745 def wjoin(self, f): 745 def wjoin(self, f, *insidef):
746 return os.path.join(self.root, f) 746 return os.path.join(self.root, f, *insidef)
747 747
748 def file(self, f): 748 def file(self, f):
749 if f[0] == '/': 749 if f[0] == '/':
750 f = f[1:] 750 f = f[1:]
751 return filelog.filelog(self.sopener, f) 751 return filelog.filelog(self.sopener, f)