[Bug 6875] New: "unknown exception" using `hg split` or `hg commit --interactive`

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Apr 29 01:16:28 UTC 2024


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

            Bug ID: 6875
           Summary: "unknown exception" using `hg split` or `hg commit
                    --interactive`
           Product: Mercurial
           Version: 6.7.2
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: errael at raelity.com
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

This is on linux, working with a clone of a githug repo; probably developed on
windows.
Wondering if this could be a line ending issue.
To experiment, since `hg split` failed, tried `hg amend --extract; hg commit
-i`, same thing.

Entered command
```
$ hg split xscreen.cpp
```

`y` for the first hunk
then `e` for the second
```
record change 2/9 to 'xscreen.cpp'?
(enter ? for help) [Ynesfdaq?] e
```

When it brings up the editor, gvim, there is the message
```
"/tmp/hg-editor-xxx.diff" [CR missing][dos]53L, 1799B
File has 39 DOS-style endings out of 53 lines.
```

In the editor, there were only `+` lines. Deleted some of them,
wrote the file, exited the editor, crash.
```
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
** Mercurial Distributed SCM (version 6.7.2)
** Extensions loaded: convert, evolve 11.1.3, extdiff, fsmonitor, graphlog,
hggit 1.1.1 (dulwich 0.21.7), histedit, purge, rebase, share, topic 1.1.3,
transplant
Traceback (most recent call last):
  File "/home/err/.venv/bin/hg", line 59, in <module>
    dispatch.run()
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 142, in run
    status = dispatch(req)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 231, in dispatch
    status = _rundispatch(req)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 275, in _rundispatch
    ret = _runcatch(req) or 0
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 456, in _runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 466, in _callcatch
    return scmutil.callcatch(ui, func)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/scmutil.py",
line 152, in callcatch
    return func()
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 446, in _runcatchfunc
    return _dispatch(req)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1271, in _dispatch
    return runcommand(
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 904, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1283, in _runcommand
    return cmdfunc()
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/dispatch.py",
line 1269, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/util.py", line
1878, in check
    return func(*args, **kwargs)
  File
"/home/err/.venv/lib/python3.10/site-packages/hgext3rd/evolve/cmdrewrite.py",
line 1169, in cmdsplit
    cmdutil.dorecord(ui, repo, commands.commit, b'commit',
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/cmdutil.py",
line 687, in dorecord
    return commit(ui, repo, func, pats, opts)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/cmdutil.py",
line 2953, in commit
    return commitfunc(ui, repo, message, matcher, opts)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/cmdutil.py",
line 527, in _record
    chunks, newopts = filterfn(ui, original_headers, match)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/cmdutil.py",
line 435, in recordfilter
    newchunks, newopts = filterchunks(
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/cmdutil.py",
line 421, in filterchunks
    return patch.filterpatch(ui, originalhunks, match, operation)
  File "/home/err/.venv/lib/python3.10/site-packages/mercurial/patch.py", line
1335, in filterpatch
    applied[newhunk.filename()].append(newhunk)
KeyError: b'xscreen.cpp\r'
```

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


More information about the Mercurial-devel mailing list