##// END OF EJS Templates
path: allow to copy a path while adjusting the url...
marmoute -
r50651:d979c76d default
parent child Browse files
Show More
@@ -878,14 +878,20 b' class path:'
878 self.rawloc = rawloc
878 self.rawloc = rawloc
879 self.loc = b'%s' % u
879 self.loc = b'%s' % u
880
880
881 def copy(self):
881 def copy(self, new_raw_location=None):
882 """make a copy of this path object"""
882 """make a copy of this path object
883
884 When `new_raw_location` is set, the new path will point to it.
885 This is used by the scheme extension so expand the scheme.
886 """
883 new = self.__class__()
887 new = self.__class__()
884 for k, v in self.__dict__.items():
888 for k, v in self.__dict__.items():
885 new_copy = getattr(v, 'copy', None)
889 new_copy = getattr(v, 'copy', None)
886 if new_copy is not None:
890 if new_copy is not None:
887 v = new_copy()
891 v = new_copy()
888 new.__dict__[k] = v
892 new.__dict__[k] = v
893 if new_raw_location is not None:
894 new._setup_url(new_raw_location)
889 return new
895 return new
890
896
891 @property
897 @property
General Comments 0
You need to be logged in to leave comments. Login now