[Bug 5839] New: `hg split` can break when using diff.ignoreblanklines

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Tue Apr 17 00:33:32 UTC 2018


https://bz.mercurial-scm.org/show_bug.cgi?id=5839

            Bug ID: 5839
           Summary: `hg split` can break when using diff.ignoreblanklines
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: record
          Assignee: bugzilla at mercurial-scm.org
          Reporter: hg at pewpew.net
                CC: mercurial-devel at mercurial-scm.org

To reproduce: 
- Create a repo with two files, bar and foo, which have the contents of: the
numbers 1-5, each on their own line (these contents don't really matter, but we
need a few lines).

- Commit
- Create a second commit, adding a blank line to bar, and another line
somewhere else (not part of the same diff hunk).  Make some modification to
foo, it doesn't matter much which
- try to split it, keeping bar in the first commit, foo in the second

Expected behavior:
 two commits

Actual behavior: 
 Never-ending series of 'no changes to record'

This seems likely to be related to "whitespace=True" on this line:
https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/cmdutil.py#l278, I
don't know why we would want split (or record...) to respect that :)

≻ hg version
Mercurial Distributed SCM (version 4.5.2+1195-a708e1e4d7a8)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2018 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


This is an untested .t file that resembles my shell when reproducing this:
  $ hg init
  $ printf '1\n2\n3\n4\n5\n' > foo
  $ cp foo bar
  $ hg ci -qAm initial
  $ printf '1\n\n2\n3\ntest\n4\n5\n' > bar
  $ printf '1\n2\n3\ntest\n4\n5\n' > foo
  $ hg ci -qm splitme
  $ hg diff -c .
  diff -r c51f1e043c06 -r 3d637dc4e862 bar
  --- a/bar       Mon Apr 16 17:24:07 2018 -0700
  +++ b/bar       Mon Apr 16 17:24:44 2018 -0700
  @@ -1,5 +1,7 @@
   1
  +
   2
   3
  +test
   4
   5
  diff -r c51f1e043c06 -r 3d637dc4e862 foo
  --- a/foo       Mon Apr 16 17:24:07 2018 -0700
  +++ b/foo       Mon Apr 16 17:24:44 2018 -0700
  @@ -1,5 +1,6 @@
   1
   2
   3
  +test
   4
   5

  $ hg --config extensions.split= --config diff.ignoreblanklines=1 split
  diff --git a/bar b/bar
  1 hunks, 1 lines changed
  examine changes to 'bar'? [Ynesfdaq?] f

  diff --git a/foo b/foo
  1 hunks, 1 lines changed
  examine changes to 'foo'? [Ynesfdaq?] n

  created new head
  diff --git a/foo b/foo
  1 hunks, 1 lines changed
  examine changes to 'foo'? [Ynesfdaq?] f

  no changes to record                                                          
  no changes to record
  <repeats forever>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list