Mercurial > hgsubversion
comparison hgsubversion/stupid.py @ 757:6e18d9ab6557
pull: stop handling .hgsvnexternals explicitely in memctx
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 19 Nov 2010 17:07:13 +0100 |
parents | 2bf300b83136 |
children | 76ebfc41f490 |
comparison
equal
deleted
inserted
replaced
756:379c7837222f | 757:6e18d9ab6557 |
---|---|
387 dpath = (branchpath and branchpath + '/' + dir) or dir | 387 dpath = (branchpath and branchpath + '/' + dir) or dir |
388 values = svn.list_props(dpath, r.revnum) | 388 values = svn.list_props(dpath, r.revnum) |
389 externals[dir] = values.get('svn:externals', '') | 389 externals[dir] = values.get('svn:externals', '') |
390 except IOError: | 390 except IOError: |
391 externals[dir] = '' | 391 externals[dir] = '' |
392 | |
393 if not externals and '.hgsvnexternals' not in parentctx: | |
394 # Do not create empty externals files | |
395 return None | |
396 return externals | 392 return externals |
397 | 393 |
398 | 394 |
399 def fetch_branchrev(svn, meta, branch, branchpath, r, parentctx): | 395 def fetch_branchrev(svn, meta, branch, branchpath, r, parentctx): |
400 """Extract all 'branch' content at a given revision. | 396 """Extract all 'branch' content at a given revision. |
602 incremental = False | 598 incremental = False |
603 if not incremental: | 599 if not incremental: |
604 files_touched, filectxfn2 = fetch_branchrev( | 600 files_touched, filectxfn2 = fetch_branchrev( |
605 svn, meta, b, branches[b], r, parentctx) | 601 svn, meta, b, branches[b], r, parentctx) |
606 | 602 |
603 externals = {} | |
607 if meta.layout != 'single': | 604 if meta.layout != 'single': |
608 externals = fetch_externals(svn, branches[b], r, parentctx) | 605 externals = fetch_externals(svn, branches[b], r, parentctx) |
609 if externals is not None: | 606 externals = svnexternals.getchanges(ui, meta.repo, parentctx, |
610 files_touched.append('.hgsvnexternals') | 607 externals) |
608 files_touched.extend(externals) | |
611 | 609 |
612 def filectxfn(repo, memctx, path): | 610 def filectxfn(repo, memctx, path): |
613 if path == '.hgsvnexternals': | 611 if path in externals: |
614 if not externals: | 612 if externals[path] is None: |
615 raise IOError(errno.ENOENT, 'no externals') | 613 raise IOError(errno.ENOENT, 'no externals') |
616 return context.memfilectx(path=path, data=externals.write(), | 614 return context.memfilectx(path=path, data=externals[path], |
617 islink=False, isexec=False, copied=None) | 615 islink=False, isexec=False, |
616 copied=None) | |
618 for bad in bad_branch_paths[b]: | 617 for bad in bad_branch_paths[b]: |
619 if path.startswith(bad): | 618 if path.startswith(bad): |
620 raise IOError(errno.ENOENT, 'Path %s is bad' % path) | 619 raise IOError(errno.ENOENT, 'Path %s is bad' % path) |
621 return filectxfn2(repo, memctx, path) | 620 return filectxfn2(repo, memctx, path) |
622 | 621 |