Bug 4459 - diff.noprefix breaks record
Summary: diff.noprefix breaks record
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Siddharth Agarwal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-18 17:56 UTC by Gregory Szorc
Modified: 2015-01-22 15:04 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Szorc 2014-11-18 17:56 UTC
$ hg init nodiff
$ cd nodiff/
$ touch foo
$ hg commit -A -m initial
adding foo
$ echo test > foo
$ hg --config diff.noprefix=False record
diff --git a/foo b/foo
1 hunks, 1 lines changed
examine changes to 'foo'? [Ynesfdaq?]
^C

$ hg --config diff.noprefix=True --traceback record
Traceback (most recent call last):
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 850, in _dispatch
    cmdpats, cmdoptions)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 611, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/pager.py", line 158, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/color.py", line 490, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 941, in _runcommand
    return checkargs()
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 912, in checkargs
    return cmdfunc()
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 847, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 679, in check
    return func(*args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 151, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 679, in check
    return func(*args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/mq.py", line 3448, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 679, in check
    return func(*args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/record.py", line 443, in record
    dorecord(ui, repo, commands.commit, 'commit', False, *pats, **opts)
  File "/Users/gps/lib/python2.7/site-packages/hgext/record.py", line 638, in dorecord
    return cmdutil.commit(ui, repo, recordfunc, pats, opts)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/cmdutil.py", line 2174, in commit
    scmutil.match(repo[None], pats, opts), opts)
  File "/Users/gps/lib/python2.7/site-packages/hgext/record.py", line 535, in recordfunc
    raise util.Abort(_('error parsing patch: %s') % err)
Abort: error parsing patch: unhandled transition: other -> hunk
abort: error parsing patch: unhandled transition: other -> hunk

According to bisection:

The first bad revision is:
changeset:   31127:f8b5c3e77d4b
user:        Siddharth Agarwal <sid0@fb.com>
date:        Wed Nov 12 23:50:21 2014 -0800
summary:     patch.trydiff: add support for noprefix
Comment 1 HG Bot 2014-12-02 16:46 UTC
Fixed by http://selenic.com/repo/hg/rev/486a1fe09422
Siddharth Agarwal <sid0@fb.com>
record: don't honor format-changing diffopts (issue4459)

record does support the whitespace options, so honor those. In upcoming patches
we'll replace all the other uses.

(please test the fix)
Comment 2 Matt Mackall 2015-01-22 15:04 UTC
Bulk testing -> fixed