##// END OF EJS Templates
commit: ignore diff whitespace settings when doing `commit -i` (issue5839)...
Kyle Lippincott -
r41698:3a01ce24 default
parent child Browse files
Show More
@@ -282,7 +282,7 b' def dorecord(ui, repo, commitfunc, cmdsu'
282 status = repo.status(match=match)
282 status = repo.status(match=match)
283 if not force:
283 if not force:
284 repo.checkcommitpatterns(wctx, vdirs, match, status, fail)
284 repo.checkcommitpatterns(wctx, vdirs, match, status, fail)
285 diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True)
285 diffopts = patch.difffeatureopts(ui, opts=opts)
286 diffopts.nodates = True
286 diffopts.nodates = True
287 diffopts.git = True
287 diffopts.git = True
288 diffopts.showfunc = True
288 diffopts.showfunc = True
@@ -3126,7 +3126,7 b' def _performrevert(repo, parents, ctx, n'
3126 # Prompt the user for changes to revert
3126 # Prompt the user for changes to revert
3127 torevert = [f for f in actions['revert'][0] if f not in excluded_files]
3127 torevert = [f for f in actions['revert'][0] if f not in excluded_files]
3128 m = scmutil.matchfiles(repo, torevert)
3128 m = scmutil.matchfiles(repo, torevert)
3129 diffopts = patch.difffeatureopts(repo.ui, whitespace=True)
3129 diffopts = patch.difffeatureopts(repo.ui)
3130 diffopts.nodates = True
3130 diffopts.nodates = True
3131 diffopts.git = True
3131 diffopts.git = True
3132 operation = 'discard'
3132 operation = 'discard'
@@ -1842,3 +1842,47 b' Test diff.unified=0'
1842 +change2
1842 +change2
1843 record change 2/2 to 'foo'? [Ynesfdaq?] y
1843 record change 2/2 to 'foo'? [Ynesfdaq?] y
1844
1844
1845 $ cd $TESTTMP
1846
1847 Test diff.ignoreblanklines=1
1848
1849 $ hg init c
1850 $ cd c
1851 $ cat > foo <<EOF
1852 > 1
1853 > 2
1854 > 3
1855 > 4
1856 > 5
1857 > EOF
1858 $ hg ci -qAm initial
1859 $ cat > foo <<EOF
1860 > 1
1861 >
1862 > 2
1863 > 3
1864 > change2
1865 > 4
1866 > 5
1867 > EOF
1868 $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.ignoreblanklines=1
1869 diff --git a/foo b/foo
1870 2 hunks, 2 lines changed
1871 examine changes to 'foo'? [Ynesfdaq?] y
1872
1873 @@ -1,3 +1,4 @@
1874 1
1875 +
1876 2
1877 3
1878 record change 1/2 to 'foo'? [Ynesfdaq?] y
1879
1880 @@ -2,4 +3,5 @@
1881 2
1882 3
1883 +change2
1884 4
1885 5
1886 record change 2/2 to 'foo'? [Ynesfdaq?] y
1887
1888
@@ -599,3 +599,111 b' Do not move things to secret even if pha'
599 a09ad58faae3 draft
599 a09ad58faae3 draft
600 e704349bd21b draft
600 e704349bd21b draft
601 a61bcde8c529 draft
601 a61bcde8c529 draft
602
603 `hg split` with ignoreblanklines=1 does not infinite loop
604
605 $ mkdir $TESTTMP/f
606 $ hg init $TESTTMP/f/a
607 $ cd $TESTTMP/f/a
608 $ printf '1\n2\n3\n4\n5\n' > foo
609 $ cp foo bar
610 $ hg ci -qAm initial
611 $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
612 $ printf '1\n2\n3\ntest\n4\n5\n' > foo
613 $ hg ci -qm splitme
614 $ cat > $TESTTMP/messages <<EOF
615 > split 1
616 > --
617 > split 2
618 > EOF
619 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
620 diff --git a/bar b/bar
621 2 hunks, 2 lines changed
622 examine changes to 'bar'? [Ynesfdaq?] f
623
624 diff --git a/foo b/foo
625 1 hunks, 1 lines changed
626 examine changes to 'foo'? [Ynesfdaq?] n
627
628 EDITOR: HG: Splitting dd3c45017cbf. Write commit message for the first split changeset.
629 EDITOR: splitme
630 EDITOR:
631 EDITOR:
632 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
633 EDITOR: HG: Leave message empty to abort commit.
634 EDITOR: HG: --
635 EDITOR: HG: user: test
636 EDITOR: HG: branch 'default'
637 EDITOR: HG: changed bar
638 created new head
639 diff --git a/foo b/foo
640 1 hunks, 1 lines changed
641 examine changes to 'foo'? [Ynesfdaq?] f
642
643 EDITOR: HG: Splitting dd3c45017cbf. So far it has been split into:
644 EDITOR: HG: - f205aea1c624: split 1
645 EDITOR: HG: Write commit message for the next split changeset.
646 EDITOR: splitme
647 EDITOR:
648 EDITOR:
649 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
650 EDITOR: HG: Leave message empty to abort commit.
651 EDITOR: HG: --
652 EDITOR: HG: user: test
653 EDITOR: HG: branch 'default'
654 EDITOR: HG: changed foo
655 saved backup bundle to $TESTTMP/f/a/.hg/strip-backup/dd3c45017cbf-463441b5-split.hg (obsstore-off !)
656
657 Let's try that again, with a slightly different set of patches, to ensure that
658 the ignoreblanklines thing isn't somehow position dependent.
659
660 $ hg init $TESTTMP/f/b
661 $ cd $TESTTMP/f/b
662 $ printf '1\n2\n3\n4\n5\n' > foo
663 $ cp foo bar
664 $ hg ci -qAm initial
665 $ printf '1\n2\n3\ntest\n4\n5\n' > bar
666 $ printf '1\n2\n3\ntest\n4\n\n5\n' > foo
667 $ hg ci -qm splitme
668 $ cat > $TESTTMP/messages <<EOF
669 > split 1
670 > --
671 > split 2
672 > EOF
673 $ printf 'f\nn\nf\n' | hg --config extensions.split= --config diff.ignoreblanklines=1 split
674 diff --git a/bar b/bar
675 1 hunks, 1 lines changed
676 examine changes to 'bar'? [Ynesfdaq?] f
677
678 diff --git a/foo b/foo
679 2 hunks, 2 lines changed
680 examine changes to 'foo'? [Ynesfdaq?] n
681
682 EDITOR: HG: Splitting 904c80b40a4a. Write commit message for the first split changeset.
683 EDITOR: splitme
684 EDITOR:
685 EDITOR:
686 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
687 EDITOR: HG: Leave message empty to abort commit.
688 EDITOR: HG: --
689 EDITOR: HG: user: test
690 EDITOR: HG: branch 'default'
691 EDITOR: HG: changed bar
692 created new head
693 diff --git a/foo b/foo
694 2 hunks, 2 lines changed
695 examine changes to 'foo'? [Ynesfdaq?] f
696
697 EDITOR: HG: Splitting 904c80b40a4a. So far it has been split into:
698 EDITOR: HG: - ffecf40fa954: split 1
699 EDITOR: HG: Write commit message for the next split changeset.
700 EDITOR: splitme
701 EDITOR:
702 EDITOR:
703 EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed.
704 EDITOR: HG: Leave message empty to abort commit.
705 EDITOR: HG: --
706 EDITOR: HG: user: test
707 EDITOR: HG: branch 'default'
708 EDITOR: HG: changed foo
709 saved backup bundle to $TESTTMP/f/b/.hg/strip-backup/904c80b40a4a-47fb907f-split.hg (obsstore-off !)
General Comments 0
You need to be logged in to leave comments. Login now