##// END OF EJS Templates
convert: fix svn file copy detection code
Patrick Mezard -
r6546:075b2c9a default
parent child Browse files
Show More
@@ -553,20 +553,19 b' class svn_source(converter_source):'
553 kind = svn.ra.check_path(self.ra, entrypath, revnum)
553 kind = svn.ra.check_path(self.ra, entrypath, revnum)
554 if kind == svn.core.svn_node_file:
554 if kind == svn.core.svn_node_file:
555 entries.append(self.recode(entry))
555 entries.append(self.recode(entry))
556
556 if not ent.copyfrom_path or not parents:
557 if not ent.copyfrom_path:
558 continue
557 continue
559 copyfrom_path = self.getrelpath(ent.copyfrom_path)
558 # Copy sources not in parent revisions cannot be represented,
559 # ignore their origin for now
560 pmodule, prevnum = self.revsplit(parents[0])[1:]
561 if ent.copyfrom_rev < prevnum:
562 continue
563 copyfrom_path = self.getrelpath(ent.copyfrom_path, pmodule)
560 if not copyfrom_path:
564 if not copyfrom_path:
561 continue
565 continue
562 self.ui.debug("copied to %s from %s@%s\n" %
566 self.ui.debug("copied to %s from %s@%s\n" %
563 (entrypath, copyfrom_path, ent.copyfrom_rev))
567 (entrypath, copyfrom_path, ent.copyfrom_rev))
564 # It's probably important for hg that the source
568 copies[self.recode(entry)] = self.recode(copyfrom_path)
565 # exists in the revision's parent, not just the
566 # ent.copyfrom_rev
567 fromkind = svn.ra.check_path(self.ra, copyfrom_path, ent.copyfrom_rev)
568 if fromkind != 0:
569 copies[self.recode(entry)] = self.recode(copyfrom_path)
570 elif kind == 0: # gone, but had better be a deleted *file*
569 elif kind == 0: # gone, but had better be a deleted *file*
571 self.ui.debug("gone from %s\n" % ent.copyfrom_rev)
570 self.ui.debug("gone from %s\n" % ent.copyfrom_rev)
572
571
@@ -117,7 +117,7 b' o branch=old3 11 branch trunk@1 into ol'
117 | | |
117 | | |
118 | o | branch= 3 change a files: a
118 | o | branch= 3 change a files: a
119 | | |
119 | | |
120 | | o branch=old 2 branch trunk, remove c files:
120 | | o branch=old 2 branch trunk, remove c files: a b
121 | |/
121 | |/
122 | o branch= 1 hello files: a b c
122 | o branch= 1 hello files: a b c
123 |/
123 |/
@@ -58,6 +58,8 b' svn up'
58 svn rm subproject/trunk/d2
58 svn rm subproject/trunk/d2
59 svn ci -m "changeb and rm d2"
59 svn ci -m "changeb and rm d2"
60 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
60 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
61 echo % copy a file from a past revision
62 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
61 echo % copy a directory from a past revision
63 echo % copy a directory from a past revision
62 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
64 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
63 cd ..
65 cd ..
@@ -60,24 +60,30 b' Transmitting file data .'
60 Committed revision 8.
60 Committed revision 8.
61
61
62 Committed revision 9.
62 Committed revision 9.
63 % copy a file from a past revision
64
65 Committed revision 10.
63 % copy a directory from a past revision
66 % copy a directory from a past revision
64
67
65 Committed revision 10.
68 Committed revision 11.
66 % convert trunk and branches
69 % convert trunk and branches
67 initializing destination A-hg repository
70 initializing destination A-hg repository
68 scanning source...
71 scanning source...
69 sorting...
72 sorting...
70 converting...
73 converting...
71 8 createtrunk
74 9 createtrunk
75 8 moved1
72 7 moved1
76 7 moved1
73 6 moved1
77 6 moved2
74 5 moved2
78 5 changeb and rm d2
75 4 changeb and rm d2
79 4 changeb and rm d2
76 3 changeb and rm d2
80 3 moved1again
77 2 moved1again
81 2 moved1again
78 1 moved1again
82 1 copyfilefrompast
79 0 copydirfrompast
83 0 copydirfrompast
80 o 8 copydirfrompast files: d2/d
84 o 9 copydirfrompast files: d2/d
85 |
86 o 8 copyfilefrompast files: d
81 |
87 |
82 o 7 moved1again files: d1/b d1/c
88 o 7 moved1again files: d1/b d1/c
83 |
89 |
@@ -95,5 +101,5 b' o | 2 moved1 files: d1/b d1/c'
95 |
101 |
96 o 0 createtrunk files:
102 o 0 createtrunk files:
97
103
98 default 8:
104 default 9:
99 d1 6:
105 d1 6:
General Comments 0
You need to be logged in to leave comments. Login now