comparison hg_delta_editor.py @ 120:f508c1fa19a5

hg_delta_editor: do not assume branches are copied from trunk by default Here is what happen in jquery repository: - kelvin-dev branch is created in r1617 with an empty directory for the datePicker plugin - commits are done - datePicker plugin is merged in trunk Before the fix, the converter assumed the initial empty commit had for parent some other commit of trunk, therefore adding all its files, which was wrong. And we ended with 'alignDemo.html' in converted trunk@5946 while it was not in the source revision.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 29 Nov 2008 11:25:01 -0600
parents ea65fe2b0856
children 58de7aea8a77
comparison
equal deleted inserted replaced
119:ea65fe2b0856 120:f508c1fa19a5
228 real_num = num 228 real_num = num
229 if real_num == 0: 229 if real_num == 0:
230 if branch in self.branches: 230 if branch in self.branches:
231 parent_branch = self.branches[branch][0] 231 parent_branch = self.branches[branch][0]
232 parent_branch_rev = self.branches[branch][1] 232 parent_branch_rev = self.branches[branch][1]
233 if parent_branch_rev <= 0:
234 return None, None
233 branch_created_rev = self.branches[branch][2] 235 branch_created_rev = self.branches[branch][2]
234 if parent_branch == 'trunk': 236 if parent_branch == 'trunk':
235 parent_branch = None 237 parent_branch = None
236 if branch_created_rev <= number+1 and branch != parent_branch: 238 if branch_created_rev <= number+1 and branch != parent_branch:
237 return self.get_parent_svn_branch_and_rev( 239 return self.get_parent_svn_branch_and_rev(
263 src_rev = paths[p].copyfrom_rev 265 src_rev = paths[p].copyfrom_rev
264 src_tag = self._is_path_tag(src_p) 266 src_tag = self._is_path_tag(src_p)
265 267
266 if not ((src_p and self._is_path_valid(src_p)) or 268 if not ((src_p and self._is_path_valid(src_p)) or
267 (src_tag and src_tag in self.tags)): 269 (src_tag and src_tag in self.tags)):
268 # we'll imply you're a branch off of trunk 270 # The branch starts here and is not a copy
269 # if you have no path, but if you do, it must be valid
270 # or else we assume trunk as well
271 src_branch = None 271 src_branch = None
272 src_rev = revision.revnum 272 src_rev = 0
273 elif src_tag: 273 elif src_tag:
274 # this is a branch created from a tag. Note that this 274 # this is a branch created from a tag. Note that this
275 # really does happen (see Django) 275 # really does happen (see Django)
276 src_branch, src_rev = self.tags[src_tag] 276 src_branch, src_rev = self.tags[src_tag]
277 else: 277 else: