Show More
@@ -350,6 +350,38 b' def _runperfilediff(' | |||
|
350 | 350 | proc.wait() |
|
351 | 351 | |
|
352 | 352 | |
|
353 | def diffpatch(ui, repo, node1a, node2, tmproot, matcher, cmdline, do3way): | |
|
354 | template = b'hg-%h.patch' | |
|
355 | with formatter.nullformatter(ui, b'extdiff', {}) as fm: | |
|
356 | cmdutil.export( | |
|
357 | repo, | |
|
358 | [repo[node1a].rev(), repo[node2].rev()], | |
|
359 | fm, | |
|
360 | fntemplate=repo.vfs.reljoin(tmproot, template), | |
|
361 | match=matcher, | |
|
362 | ) | |
|
363 | label1a = cmdutil.makefilename(repo[node1a], template) | |
|
364 | label2 = cmdutil.makefilename(repo[node2], template) | |
|
365 | dir1a = repo.vfs.reljoin(tmproot, label1a) | |
|
366 | dir2 = repo.vfs.reljoin(tmproot, label2) | |
|
367 | dir1b = None | |
|
368 | label1b = None | |
|
369 | cmdline = formatcmdline( | |
|
370 | cmdline, | |
|
371 | repo.root, | |
|
372 | do3way=do3way, | |
|
373 | parent1=dir1a, | |
|
374 | plabel1=label1a, | |
|
375 | parent2=dir1b, | |
|
376 | plabel2=label1b, | |
|
377 | child=dir2, | |
|
378 | clabel=label2, | |
|
379 | ) | |
|
380 | ui.debug(b'running %r in %s\n' % (pycompat.bytestr(cmdline), tmproot)) | |
|
381 | ui.system(cmdline, cwd=tmproot, blockedtag=b'extdiff') | |
|
382 | return 1 | |
|
383 | ||
|
384 | ||
|
353 | 385 | def dodiff(ui, repo, cmdline, pats, opts, guitool=False): |
|
354 | 386 | '''Do the actual diff: |
|
355 | 387 | |
@@ -416,18 +448,20 b' def dodiff(ui, repo, cmdline, pats, opts' | |||
|
416 | 448 | |
|
417 | 449 | tmproot = pycompat.mkdtemp(prefix=b'extdiff.') |
|
418 | 450 | try: |
|
419 |
if |
|
|
451 | if opts.get(b'patch'): | |
|
452 | return diffpatch( | |
|
453 | ui, repo, node1a, node2, tmproot, matcher, cmdline, do3way | |
|
454 | ) | |
|
455 | ||
|
420 | 456 |
|
|
421 | 457 |
|
|
422 |
|
|
|
423 | 0 | |
|
424 | ] | |
|
458 | dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot, subrepos)[0] | |
|
425 | 459 |
|
|
426 | 460 |
|
|
427 | 461 |
|
|
428 | dir1b = snapshot( | |
|
429 | ui, repo, dir1b_files, node1b, tmproot, subrepos | |
|
430 |
|
|
|
462 | dir1b = snapshot(ui, repo, dir1b_files, node1b, tmproot, subrepos)[ | |
|
463 | 0 | |
|
464 | ] | |
|
431 | 465 |
|
|
432 | 466 |
|
|
433 | 467 |
|
@@ -473,23 +507,6 b' def dodiff(ui, repo, cmdline, pats, opts' | |||
|
473 | 507 |
|
|
474 | 508 |
|
|
475 | 509 |
|
|
476 | else: | |
|
477 | template = b'hg-%h.patch' | |
|
478 | with formatter.nullformatter(ui, b'extdiff', {}) as fm: | |
|
479 | cmdutil.export( | |
|
480 | repo, | |
|
481 | [repo[node1a].rev(), repo[node2].rev()], | |
|
482 | fm, | |
|
483 | fntemplate=repo.vfs.reljoin(tmproot, template), | |
|
484 | match=matcher, | |
|
485 | ) | |
|
486 | label1a = cmdutil.makefilename(repo[node1a], template) | |
|
487 | label2 = cmdutil.makefilename(repo[node2], template) | |
|
488 | dir1a = repo.vfs.reljoin(tmproot, label1a) | |
|
489 | dir2 = repo.vfs.reljoin(tmproot, label2) | |
|
490 | dir1b = None | |
|
491 | label1b = None | |
|
492 | fnsandstat = [] | |
|
493 | 510 | |
|
494 | 511 | if not perfile: |
|
495 | 512 | # Run the external tool on the 2 temp directories or the patches |
General Comments 0
You need to be logged in to leave comments.
Login now