[Bug 6175] New: `obslog --patch` shows incorrect spacing when `diff.word-diff=True` is set

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Wed Jul 24 04:18:45 EDT 2019


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

            Bug ID: 6175
           Summary: `obslog --patch` shows incorrect spacing when
                    `diff.word-diff=True` is set
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: evolution
          Assignee: bugzilla at mercurial-scm.org
          Reporter: 7895pulkit at gmail.com
                CC: mercurial-devel at mercurial-scm.org,
                    pierre-yves.david at ens-lyon.org

The related part of code is
https://www.mercurial-scm.org/repo/evolve/file/tip/hgext3rd/evolve/obshistory.py#l612.

That `fm.plain('    ')` call is to align each line of diff output. However in
case of worddiff, chunks can be part of lines and not complete lines which
leads to addition of 4 spaces in between of lines.

For ex:

```
    diff --git a/mercurial/commands.py b/mercurial/commands.py
    --- a/mercurial/commands.py
    +++ b/mercurial/commands.py
    @@ -6213,9 +6213,11 @@ def unshelve(ui, repo, *shelved, **opts)

            Selected changes can be unshelved with ``--interactive`` flag.
            The working directory is updated with the selected changes, and
    -           only the unselected changes remain shelved.     Note that the
user will
    -               get into         conflicts         whenever the        
shelved         change has         conflicts         with
    -           the     working directory     regardless     of     the    
changes     requested by         the user    .
    +           only the unselected changes remain shelved.
    +               Note:         The         whole         shelve         is  
      applied         to     working directory     first before
    +           running interactively. So, this will bring up all the conflicts
between
    +           working directory and the shelve, irrespective     of     which
    changes     will         be
    +           unshelved    .
         """
         with repo.wlock():
             return shelvemod.dounshelve(ui, repo, *shelved, **opts)
```

Works fine when running with `--config diff.word-diff=0`

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


More information about the Mercurial-devel mailing list