Commits

Anonymous committed c1d6c75

[svn] fix bug in parent repository detection

  • Participants
  • Parent commits a294b8f

Comments (0)

Files changed (1)

File hgsvn/run/hgimportsvn.py

         run_hg(["init"])
     if svn_copyfrom_path:
         # Try to find an hg repo tracking the SVN branch which was copied
-        copyfrom_branch = svn_copyfrom_path.lstrip("/")
+        copyfrom_branch = svn_copyfrom_path.split("/")[-1]
         hg_copyfrom = os.path.join("..", copyfrom_branch)
         if (os.path.exists(os.path.join(hg_copyfrom, ".hg")) and
             os.path.exists(os.path.join(hg_copyfrom, ".svn"))):
                         continue
                     tag = line.split(None, 1)[0]
                     tag_num = int(tag.split(".")[1])
-                    if tag_num <= svn_rev and (not best_tag or best_tag < tag_num):
+                    if tag_num <= svn_copyfrom_revision and (not best_tag or best_tag < tag_num):
                         best_tag = tag_num
                 if not best_tag:
                     print "No hg tag matching rev %s in %s" % (svn_rev, hg_copyfrom)