Show More
@@ -8,6 +8,7 b'' | |||
|
8 | 8 | |
|
9 | 9 | import copy as copymod |
|
10 | 10 | import errno |
|
11 | import functools | |
|
11 | 12 | import os |
|
12 | 13 | import re |
|
13 | 14 | |
@@ -440,22 +441,17 b' def recordfilter(ui, originalhunks, matc' | |||
|
440 | 441 | return newchunks, newopts |
|
441 | 442 | |
|
442 | 443 | |
|
443 |
def |
|
|
444 | ui, repo, commitfunc, cmdsuggest, backupall, filterfn, *pats, **opts | |
|
444 | def _record( | |
|
445 | ui, | |
|
446 | repo, | |
|
447 | message, | |
|
448 | match, | |
|
449 | opts, | |
|
450 | commitfunc, | |
|
451 | backupall, | |
|
452 | filterfn, | |
|
453 | pats, | |
|
445 | 454 | ): |
|
446 | opts = pycompat.byteskwargs(opts) | |
|
447 | if not ui.interactive(): | |
|
448 | if cmdsuggest: | |
|
449 | msg = _(b'running non-interactively, use %s instead') % cmdsuggest | |
|
450 | else: | |
|
451 | msg = _(b'running non-interactively') | |
|
452 | raise error.InputError(msg) | |
|
453 | ||
|
454 | # make sure username is set before going interactive | |
|
455 | if not opts.get(b'user'): | |
|
456 | ui.username() # raise exception, username not provided | |
|
457 | ||
|
458 | def recordfunc(ui, repo, message, match, opts): | |
|
459 | 455 |
|
|
460 | 456 | |
|
461 | 457 |
|
@@ -476,10 +472,7 b' def dorecord(' | |||
|
476 | 472 |
|
|
477 | 473 |
|
|
478 | 474 |
|
|
479 | _( | |
|
480 | b'cannot partially commit a merge ' | |
|
481 | b'(use "hg commit" instead)' | |
|
482 | ) | |
|
475 | _(b'cannot partially commit a merge ' b'(use "hg commit" instead)') | |
|
483 | 476 |
|
|
484 | 477 | |
|
485 | 478 |
|
@@ -597,9 +590,7 b' def dorecord(' | |||
|
597 | 590 |
|
|
598 | 591 |
|
|
599 | 592 |
|
|
600 |
|
|
|
601 | + crecordmod.patchhelptext | |
|
602 | + fp.read() | |
|
593 | crecordmod.diffhelptext + crecordmod.patchhelptext + fp.read() | |
|
603 | 594 |
|
|
604 | 595 |
|
|
605 | 596 |
|
@@ -670,7 +661,31 b' def dorecord(' | |||
|
670 | 661 |
|
|
671 | 662 |
|
|
672 | 663 | |
|
673 | return commit(ui, repo, recordfunc, pats, opts) | |
|
664 | ||
|
665 | def dorecord( | |
|
666 | ui, repo, commitfunc, cmdsuggest, backupall, filterfn, *pats, **opts | |
|
667 | ): | |
|
668 | opts = pycompat.byteskwargs(opts) | |
|
669 | if not ui.interactive(): | |
|
670 | if cmdsuggest: | |
|
671 | msg = _(b'running non-interactively, use %s instead') % cmdsuggest | |
|
672 | else: | |
|
673 | msg = _(b'running non-interactively') | |
|
674 | raise error.InputError(msg) | |
|
675 | ||
|
676 | # make sure username is set before going interactive | |
|
677 | if not opts.get(b'user'): | |
|
678 | ui.username() # raise exception, username not provided | |
|
679 | ||
|
680 | func = functools.partial( | |
|
681 | _record, | |
|
682 | commitfunc=commitfunc, | |
|
683 | backupall=backupall, | |
|
684 | filterfn=filterfn, | |
|
685 | pats=pats, | |
|
686 | ) | |
|
687 | ||
|
688 | return commit(ui, repo, func, pats, opts) | |
|
674 | 689 | |
|
675 | 690 | |
|
676 | 691 | class dirnode: |
General Comments 0
You need to be logged in to leave comments.
Login now