Show More
@@ -102,6 +102,21 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
102 | Find moves and copies between m1 and m2 back to limit linkrev |
|
102 | Find moves and copies between m1 and m2 back to limit linkrev | |
103 | """ |
|
103 | """ | |
104 |
|
104 | |||
|
105 | def dirname(f): | |||
|
106 | s = f.rfind("/") | |||
|
107 | if s == -1: | |||
|
108 | return "" | |||
|
109 | return f[:s] | |||
|
110 | ||||
|
111 | def dirs(files): | |||
|
112 | d = {} | |||
|
113 | for f in files: | |||
|
114 | f = dirname(f) | |||
|
115 | while f not in d: | |||
|
116 | d[f] = True | |||
|
117 | f = dirname(f) | |||
|
118 | return d | |||
|
119 | ||||
105 | def findold(fctx): |
|
120 | def findold(fctx): | |
106 | "find files that path was copied from, back to linkrev limit" |
|
121 | "find files that path was copied from, back to linkrev limit" | |
107 | old = {} |
|
122 | old = {} | |
@@ -146,12 +161,6 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
146 | continue |
|
161 | continue | |
147 | copy[c.path()] = of |
|
162 | copy[c.path()] = of | |
148 |
|
163 | |||
149 | def dirs(files): |
|
|||
150 | d = {} |
|
|||
151 | for f in files: |
|
|||
152 | d[os.path.dirname(f)] = True |
|
|||
153 | return d |
|
|||
154 |
|
||||
155 | if not repo.ui.configbool("merge", "followcopies", True): |
|
164 | if not repo.ui.configbool("merge", "followcopies", True): | |
156 | return {} |
|
165 | return {} | |
157 |
|
166 | |||
@@ -183,7 +192,7 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
183 | # examine each file copy for a potential directory move, which is |
|
192 | # examine each file copy for a potential directory move, which is | |
184 | # when all the files in a directory are moved to a new directory |
|
193 | # when all the files in a directory are moved to a new directory | |
185 | for dst, src in fullcopy.items(): |
|
194 | for dst, src in fullcopy.items(): | |
186 |
dsrc, ddst = |
|
195 | dsrc, ddst = dirname(src), dirname(dst) | |
187 | if dsrc in invalid: |
|
196 | if dsrc in invalid: | |
188 | # already seen to be uninteresting |
|
197 | # already seen to be uninteresting | |
189 | continue |
|
198 | continue |
General Comments 0
You need to be logged in to leave comments.
Login now