##// 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 878 self.rawloc = rawloc
879 879 self.loc = b'%s' % u
880 880
881 def copy(self):
882 """make a copy of this path object"""
881 def copy(self, new_raw_location=None):
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 887 new = self.__class__()
884 888 for k, v in self.__dict__.items():
885 889 new_copy = getattr(v, 'copy', None)
886 890 if new_copy is not None:
887 891 v = new_copy()
888 892 new.__dict__[k] = v
893 if new_raw_location is not None:
894 new._setup_url(new_raw_location)
889 895 return new
890 896
891 897 @property
General Comments 0
You need to be logged in to leave comments. Login now