comparison hgext/convert/subversion.py @ 8843:eb7b247a98ea

kill trailing whitespace
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 19 Jun 2009 13:47:50 +0200
parents c5f36402daad
children 76d3cd914c5e
comparison
equal deleted inserted replaced
8842:acd03a6e2426 8843:eb7b247a98ea
470 # /tags/tag.1 (from /trunk:10) 470 # /tags/tag.1 (from /trunk:10)
471 # /tags/tag.1/foo (from /branches/foo:12) 471 # /tags/tag.1/foo (from /branches/foo:12)
472 # Here/tags/tag.1 discarded as well as its children. 472 # Here/tags/tag.1 discarded as well as its children.
473 # It happens with tools like cvs2svn. Such tags cannot 473 # It happens with tools like cvs2svn. Such tags cannot
474 # be represented in mercurial. 474 # be represented in mercurial.
475 addeds = dict((p, e.copyfrom_path) for p,e 475 addeds = dict((p, e.copyfrom_path) for p, e
476 in origpaths.iteritems() if e.action == 'A') 476 in origpaths.iteritems() if e.action == 'A')
477 badroots = set() 477 badroots = set()
478 for destroot in addeds: 478 for destroot in addeds:
479 for source, sourcerev, dest in pendings: 479 for source, sourcerev, dest in pendings:
480 if (not dest.startswith(destroot + '/') 480 if (not dest.startswith(destroot + '/')
482 continue 482 continue
483 badroots.add(destroot) 483 badroots.add(destroot)
484 break 484 break
485 485
486 for badroot in badroots: 486 for badroot in badroots:
487 pendings = [p for p in pendings if p[2] != badroot 487 pendings = [p for p in pendings if p[2] != badroot
488 and not p[2].startswith(badroot + '/')] 488 and not p[2].startswith(badroot + '/')]
489 489
490 # Tell tag renamings from tag creations 490 # Tell tag renamings from tag creations
491 remainings = [] 491 remainings = []
492 for source, sourcerev, dest in pendings: 492 for source, sourcerev, dest in pendings:
495 remainings.append([source, sourcerev, tagname]) 495 remainings.append([source, sourcerev, tagname])
496 continue 496 continue
497 if tagname in tags: 497 if tagname in tags:
498 # Keep the latest tag value 498 # Keep the latest tag value
499 continue 499 continue
500 # From revision may be fake, get one with changes 500 # From revision may be fake, get one with changes
501 try: 501 try:
502 tagid = self.latest(source, sourcerev) 502 tagid = self.latest(source, sourcerev)
503 if tagid and tagname not in tags: 503 if tagid and tagname not in tags:
504 tags[tagname] = tagid 504 tags[tagname] = tagid
505 except SvnPathNotFound: 505 except SvnPathNotFound: