Mercurial > hgsubversion
comparison fetch_command.py @ 97:0d3a2a7cefa3
hg_delta_editor: fix symlink prefix confusion
- SubversionRepo.get_file() strips the symlink prefix
- Enforce that hg_delta_editor symlink data always contains the prefix. The
alternative was seducing and more consistent with hg content but it makes the
code more complicated since svn:special can be set before or after the content
is set, and we need it in apply_textdelta()
This issue fixes jQuery repository conversion at r3674.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 20 Nov 2008 22:41:15 -0600 |
parents | 4c419603d41b |
children | c7ac013cf7fd |
comparison
equal
deleted
inserted
replaced
96:9b5e528f67f8 | 97:0d3a2a7cefa3 |
---|---|
152 if svn.subdir: | 152 if svn.subdir: |
153 p2 = p2[len(svn.subdir)-1:] | 153 p2 = p2[len(svn.subdir)-1:] |
154 cleanup_file_handles(svn, i) | 154 cleanup_file_handles(svn, i) |
155 i += 1 | 155 i += 1 |
156 data, mode = svn.get_file(p2, r.revnum) | 156 data, mode = svn.get_file(p2, r.revnum) |
157 hg_editor.current_files[p] = data | 157 hg_editor.set_file(p, data, 'x' in mode, 'l' in mode) |
158 hg_editor.current_files_exec[p] = 'x' in mode | |
159 hg_editor.current_files_symlink[p] = 'l' in mode | |
160 hg_editor.missing_plaintexts = set() | 158 hg_editor.missing_plaintexts = set() |
161 hg_editor.ui.status('\n') | 159 hg_editor.ui.status('\n') |
162 hg_editor.commit_current_delta() | 160 hg_editor.commit_current_delta() |
163 | 161 |
164 | 162 |
337 deleted = [f for f in parentctx if f.startswith(path)] | 335 deleted = [f for f in parentctx if f.startswith(path)] |
338 files += deleted | 336 files += deleted |
339 | 337 |
340 copies = getcopies(svn, hg_editor, branch, branchpath, r, files, parentid) | 338 copies = getcopies(svn, hg_editor, branch, branchpath, r, files, parentid) |
341 | 339 |
342 linkprefix = 'link ' | |
343 def filectxfn(repo, memctx, path): | 340 def filectxfn(repo, memctx, path): |
344 data, mode = svn.get_file(branchpath + '/' + path, r.revnum) | 341 data, mode = svn.get_file(branchpath + '/' + path, r.revnum) |
345 isexec = 'x' in mode | 342 isexec = 'x' in mode |
346 islink = 'l' in mode | 343 islink = 'l' in mode |
347 if islink and data.startswith(linkprefix): | |
348 data = data[len(linkprefix):] | |
349 copied = copies.get(path) | 344 copied = copies.get(path) |
350 return context.memfilectx(path=path, data=data, islink=islink, | 345 return context.memfilectx(path=path, data=data, islink=islink, |
351 isexec=isexec, copied=copied) | 346 isexec=isexec, copied=copied) |
352 | 347 |
353 return files, filectxfn | 348 return files, filectxfn |