Mercurial > hgsubversion
comparison fetch_command.py @ 89:edeec6829d80
SubversionRepo: remember svn.diff3() does not work
Calling it repeatedly is expensive, files and directories are created,
svn transport layer is reset.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 14 Nov 2008 16:18:24 -0600 |
parents | 3b60f223893a |
children | 4c419603d41b |
comparison
equal
deleted
inserted
replaced
88:3b60f223893a | 89:edeec6829d80 |
---|---|
366 parent_ha = hg_editor.get_parent_revision(r.revnum, b) | 366 parent_ha = hg_editor.get_parent_revision(r.revnum, b) |
367 files_touched = set() | 367 files_touched = set() |
368 link_files = {} | 368 link_files = {} |
369 exec_files = {} | 369 exec_files = {} |
370 try: | 370 try: |
371 try: | 371 if br_p == b: |
372 if br_p == b: | 372 # letting patch handle binaries sounded |
373 # letting patch handle binaries sounded | 373 # cool, but it breaks patch in sad ways |
374 # cool, but it breaks patch in sad ways | 374 d = svn.get_unified_diff(diff_path, r.revnum, deleted=False, |
375 d = svn.get_unified_diff(diff_path, r.revnum, deleted=False, | 375 ignore_type=False) |
376 ignore_type=False) | 376 else: |
377 else: | 377 d = svn.get_unified_diff(diff_path, r.revnum, |
378 d = svn.get_unified_diff(diff_path, r.revnum, | 378 other_path=make_diff_path(br_p), |
379 other_path=make_diff_path(br_p), | 379 other_rev=parent_rev, |
380 other_rev=parent_rev, | 380 deleted=True, ignore_type=True) |
381 deleted=True, ignore_type=True) | 381 if d: |
382 if d: | 382 ui.status('Branch creation with mods, pulling full rev.\n') |
383 ui.status('Branch creation with mods, pulling full rev.\n') | 383 raise BadPatchApply() |
384 raise BadPatchApply() | 384 |
385 except core.SubversionException, e: | |
386 # "Can't write to stream: The handle is invalid." | |
387 # This error happens systematically under Windows, possibly | |
388 # related to file handles being non-write shareable by default. | |
389 if e.apr_err != 720006: | |
390 raise | |
391 raise BadPatchApply() | |
392 | |
393 for m in binary_file_re.findall(d): | 385 for m in binary_file_re.findall(d): |
394 # we have to pull each binary file by hand as a fulltext, | 386 # we have to pull each binary file by hand as a fulltext, |
395 # which sucks but we've got no choice | 387 # which sucks but we've got no choice |
396 file_path = os.path.join(our_tempdir, m) | 388 file_path = os.path.join(our_tempdir, m) |
397 files_touched.add(m) | 389 files_touched.add(m) |
515 link_path = open(path).read() | 507 link_path = open(path).read() |
516 link_path = link_path[len('link '):] | 508 link_path = link_path[len('link '):] |
517 os.remove(path) | 509 os.remove(path) |
518 link_files[m] = link_path | 510 link_files[m] = link_path |
519 files_touched.add(m) | 511 files_touched.add(m) |
520 except (core.SubversionException, BadPatchApply), e: | 512 except (core.SubversionException, |
513 BadPatchApply, | |
514 svnwrap.SubversionRepoCanNotDiff), e: | |
521 if (hasattr(e, 'apr_err') and e.apr_err != 160013): | 515 if (hasattr(e, 'apr_err') and e.apr_err != 160013): |
522 raise | 516 raise |
523 # Either this revision or the previous one does not exist. | 517 # Either this revision or the previous one does not exist. |
524 ui.status("fetching entire rev previous rev does not exist.\n") | 518 ui.status("fetching entire rev previous rev does not exist.\n") |
525 files_touched, filectxfn = stupid_fetch_branchrev( | 519 files_touched, filectxfn = stupid_fetch_branchrev( |