Mercurial > hgsubversion
comparison fetch_command.py @ 88:3b60f223893a
fetch_command: handle nullid parent in stupid non-diffy mode
| author | Patrick Mezard <pmezard@gmail.com> |
|---|---|
| date | Fri, 14 Nov 2008 16:18:24 -0600 |
| parents | b033d74be76b |
| children | edeec6829d80 |
comparison
equal
deleted
inserted
replaced
| 87:b033d74be76b | 88:3b60f223893a |
|---|---|
| 304 def filectxfn(repo, memctx, path): | 304 def filectxfn(repo, memctx, path): |
| 305 raise IOError() | 305 raise IOError() |
| 306 return files, filectxfn | 306 return files, filectxfn |
| 307 | 307 |
| 308 files = [] | 308 files = [] |
| 309 branchprefix = branchpath + '/' | 309 if parentid == revlog.nullid: |
| 310 for path, e in r.paths.iteritems(): | 310 # Initial revision, fetch all files |
| 311 if not path.startswith(branchprefix): | 311 for path, kind in svn.list_files(branchpath, r.revnum): |
| 312 continue | 312 if kind == 'f': |
| 313 kind = svn.checkpath(path, r.revnum) | 313 files.append(path) |
| 314 path = path[len(branchprefix):] | 314 else: |
| 315 if kind == 'f': | 315 branchprefix = branchpath + '/' |
| 316 files.append(path) | 316 for path, e in r.paths.iteritems(): |
| 317 elif kind == 'd': | 317 if not path.startswith(branchprefix): |
| 318 if e.action == 'M': | |
| 319 # Ignore property changes for now | |
| 320 continue | 318 continue |
| 321 dirpath = branchprefix + path | 319 kind = svn.checkpath(path, r.revnum) |
| 322 for child, k in svn.list_files(dirpath, r.revnum): | 320 path = path[len(branchprefix):] |
| 323 if k == 'f': | 321 if kind == 'f': |
| 324 files.append(path + '/' + child) | |
| 325 else: | |
| 326 if path in parentctx: | |
| 327 files.append(path) | 322 files.append(path) |
| 328 continue | 323 elif kind == 'd': |
| 329 # Assume it's a deleted directory | 324 if e.action == 'M': |
| 330 path = path + '/' | 325 # Ignore property changes for now |
| 331 deleted = [f for f in parentctx if f.startswith(path)] | 326 continue |
| 332 files += deleted | 327 dirpath = branchprefix + path |
| 328 for child, k in svn.list_files(dirpath, r.revnum): | |
| 329 if k == 'f': | |
| 330 files.append(path + '/' + child) | |
| 331 else: | |
| 332 if path in parentctx: | |
| 333 files.append(path) | |
| 334 continue | |
| 335 # Assume it's a deleted directory | |
| 336 path = path + '/' | |
| 337 deleted = [f for f in parentctx if f.startswith(path)] | |
| 338 files += deleted | |
| 333 | 339 |
| 334 copies = getcopies(svn, hg_editor, branch, branchpath, r, files, parentid) | 340 copies = getcopies(svn, hg_editor, branch, branchpath, r, files, parentid) |
| 335 | 341 |
| 336 linkprefix = 'link ' | 342 linkprefix = 'link ' |
| 337 def filectxfn(repo, memctx, path): | 343 def filectxfn(repo, memctx, path): |
