comparison fetch_command.py @ 79:2e47623fa174

fetch_command: handle failing svn.diff3() on Windows, fetch full revision
author Patrick Mezard <pmezard@gmail.com>
date Sun, 09 Nov 2008 18:08:35 -0600
parents ed3dd5bf45da
children b033d74be76b
comparison
equal deleted inserted replaced
78:072010a271c6 79:2e47623fa174
338 parent_ha = hg_editor.get_parent_revision(r.revnum, b) 338 parent_ha = hg_editor.get_parent_revision(r.revnum, b)
339 files_touched = set() 339 files_touched = set()
340 link_files = {} 340 link_files = {}
341 exec_files = {} 341 exec_files = {}
342 try: 342 try:
343 if br_p == b: 343 try:
344 d = svn.get_unified_diff(diff_path, r.revnum, deleted=False, 344 if br_p == b:
345 # letting patch handle binaries sounded 345 # letting patch handle binaries sounded
346 # cool, but it breaks patch in sad ways 346 # cool, but it breaks patch in sad ways
347 ignore_type=False) 347 d = svn.get_unified_diff(diff_path, r.revnum, deleted=False,
348 else: 348 ignore_type=False)
349 d = svn.get_unified_diff(diff_path, r.revnum, 349 else:
350 other_path=make_diff_path(br_p), 350 d = svn.get_unified_diff(diff_path, r.revnum,
351 other_rev=parent_rev, 351 other_path=make_diff_path(br_p),
352 deleted=True, ignore_type=True) 352 other_rev=parent_rev,
353 if d: 353 deleted=True, ignore_type=True)
354 ui.status('Branch creation with mods, pulling full rev.\n') 354 if d:
355 raise BadPatchApply() 355 ui.status('Branch creation with mods, pulling full rev.\n')
356 raise BadPatchApply()
357 except core.SubversionException, e:
358 # "Can't write to stream: The handle is invalid."
359 # This error happens systematically under Windows, possibly
360 # related to file handles being non-write shareable by default.
361 if e.apr_err != 720006:
362 raise
363 raise BadPatchApply()
364
356 for m in binary_file_re.findall(d): 365 for m in binary_file_re.findall(d):
357 # we have to pull each binary file by hand as a fulltext, 366 # we have to pull each binary file by hand as a fulltext,
358 # which sucks but we've got no choice 367 # which sucks but we've got no choice
359 file_path = os.path.join(our_tempdir, m) 368 file_path = os.path.join(our_tempdir, m)
360 files_touched.add(m) 369 files_touched.add(m)