##// END OF EJS Templates
convert: restore previous svn transport parent correctly
Patrick Mezard -
r6847:9d6d1fdb default
parent child Browse files
Show More
@@ -188,6 +188,7 b' class svn_source(converter_source):'
188 # Module is either empty or a repository path starting with
188 # Module is either empty or a repository path starting with
189 # a slash and not ending with a slash.
189 # a slash and not ending with a slash.
190 self.module = self.url[len(self.base):]
190 self.module = self.url[len(self.base):]
191 self.prevmodule = None
191 self.rootmodule = self.module
192 self.rootmodule = self.module
192 self.commits = {}
193 self.commits = {}
193 self.paths = {}
194 self.paths = {}
@@ -478,9 +479,9 b' class svn_source(converter_source):'
478 if not stop:
479 if not stop:
479 stop = svn.ra.get_latest_revnum(self.ra)
480 stop = svn.ra.get_latest_revnum(self.ra)
480 try:
481 try:
481 self.reparent('')
482 prevmodule = self.reparent('')
482 dirent = svn.ra.stat(self.ra, path.strip('/'), stop)
483 dirent = svn.ra.stat(self.ra, path.strip('/'), stop)
483 self.reparent(self.module)
484 self.reparent(prevmodule)
484 except SubversionException:
485 except SubversionException:
485 dirent = None
486 dirent = None
486 if not dirent:
487 if not dirent:
@@ -532,9 +533,17 b' class svn_source(converter_source):'
532 return svn_rev in self.blacklist
533 return svn_rev in self.blacklist
533
534
534 def reparent(self, module):
535 def reparent(self, module):
535 svn_url = self.base + module
536 """Reparent the svn transport and return the previous parent."""
536 self.ui.debug("reparent to %s\n" % svn_url.encode(self.encoding))
537 if self.prevmodule == module:
537 svn.ra.reparent(self.ra, svn_url.encode(self.encoding))
538 return module
539 svn_url = (self.base + module).encode(self.encoding)
540 prevmodule = self.prevmodule
541 if prevmodule is None:
542 prevmodule = ''
543 self.ui.debug("reparent to %s\n" % svn_url)
544 svn.ra.reparent(self.ra, svn_url)
545 self.prevmodule = module
546 return prevmodule
538
547
539 def expandpaths(self, rev, paths, parents):
548 def expandpaths(self, rev, paths, parents):
540 entries = []
549 entries = []
@@ -604,9 +613,9 b' class svn_source(converter_source):'
604
613
605 # We can avoid the reparent calls if the module has not changed
614 # We can avoid the reparent calls if the module has not changed
606 # but it probably does not worth the pain.
615 # but it probably does not worth the pain.
607 self.reparent('')
616 prevmodule = self.reparent('')
608 fromkind = svn.ra.check_path(self.ra, entrypath.strip('/'), fromrev)
617 fromkind = svn.ra.check_path(self.ra, entrypath.strip('/'), fromrev)
609 self.reparent(self.module)
618 self.reparent(prevmodule)
610
619
611 if fromkind == svn.core.svn_node_file: # a deleted file
620 if fromkind == svn.core.svn_node_file: # a deleted file
612 entries.append(self.recode(entry))
621 entries.append(self.recode(entry))
General Comments 0
You need to be logged in to leave comments. Login now