Mercurial > hgsubversion
comparison hgsubversion/svnmeta.py @ 1530:9a3b2b3fe4ce
meta: more forceutf8 love, this time on subdir handling
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 31 Aug 2017 23:02:40 -0400 |
parents | 4e28e01f57da |
children | 4dad506e51cc |
comparison
equal
deleted
inserted
replaced
1529:dee572a4e30b | 1530:9a3b2b3fe4ce |
---|---|
225 | 225 |
226 def _get_subdir(self): | 226 def _get_subdir(self): |
227 return self.__subdir | 227 return self.__subdir |
228 | 228 |
229 def _set_subdir(self, subdir): | 229 def _set_subdir(self, subdir): |
230 subdir = util.forceutf8(subdir) | |
230 if subdir: | 231 if subdir: |
231 subdir = '/'.join(p for p in subdir.split('/') if p) | 232 subdir = '/'.join(p for p in subdir.split('/') if p) |
232 | 233 |
233 self.__subdir = None | 234 self.__subdir = None |
234 subdirfile = os.path.join(self.metapath, 'subdir') | 235 subdirfile = os.path.join(self.metapath, 'subdir') |
444 | 445 |
445 def normalize(self, path): | 446 def normalize(self, path): |
446 '''Normalize a path to strip of leading slashes and our subdir if we | 447 '''Normalize a path to strip of leading slashes and our subdir if we |
447 have one. | 448 have one. |
448 ''' | 449 ''' |
450 path = util.forceutf8(path) | |
449 if self.subdir and path == self.subdir[:-1]: | 451 if self.subdir and path == self.subdir[:-1]: |
450 return '' | 452 return '' |
451 if path and path[0] == '/': | 453 if path and path[0] == '/': |
452 path = path[1:] | 454 path = path[1:] |
453 if path == self.subdir: | 455 if path == self.subdir: |