$ hg init
$ echo 0 > f1
$ hg add f1
$ hg qnew -f p0
$ hg mv f1 f2
$ hg qpop -f
popping p0
patch queue now empty
$ hg stat
A f2
$ cat f2
0
$ hg ci -m0
...
File "/home/mk/src/hg/mercurial/localrepo.py", line 957, in commit
ret = self.commitctx(cctx, True)
File "/home/mk/src/hg/mercurial/localrepo.py", line 1004, in commitctx
changed)
File "/home/mk/src/hg/mercurial/localrepo.py", line 827, in _filecommit
self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev)))
TypeError: must be string or buffer, not None
[1]
For a starter we could abort instead of crashing...:
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -823,6 +823,9 @@
if cfname in ancestor:
crev = ancestor[cfname].filenode()
break
+ if not crev:
+ raise util.Abort(_("%s: copy source %s not found") %
+ (fname, cfname))
self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev)))
meta["copy"] = cfname
|
I get an error:
TypeError: b2a_hex() argument 1 must be string or read-only buffer, not None
when running trying to commit after moving files around and then using qpop.
This bug might have the same underlying cause as
http://mercurial.selenic.com/bts/issue2038
and might be related to
http://mercurial.selenic.com/bts/issue1476
http://mercurial.selenic.com/bts/issue1441
http://www.selenic.com/pipermail/mercurial/2009-January/023270.html
but since I triggered the error with a different set of steps, I'm going to
report this anyway and let someone that knows more about hg figure out if
it's actually a duplicate.
The following set of steps cause an error:
hg init x
cd x
mkdir src
echo foo > src/file1
hg add src/file1
hg ci -m file1msg
echo bar > src/file2
hg add src/file2
hg qnew -f testmq
hg mv src src2
hg qpop
hg qpop -f
hg stat
hg ci -m testci
The full error is:
transaction abort!
rollback completed
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 1.5)
** Extensions loaded: convert, mq, hgk, extdiff
Traceback (most recent call last):
File "/u/int5sys/opt/mercurial-1.5/bin/hg", line 27, in <module>
mercurial.dispatch.run()
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 16, in run
sys.exit(dispatch(sys.argv[1:]))
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 30, in dispatch
return _runcatch(u, args)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 47, in _runcatch
return _dispatch(ui, args)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 466, in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 336, in runcommand
ret = _runcommand(ui, options, cmd, d)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 517, in _runcommand
return checkargs()
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 471, in checkargs
return cmdfunc()
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/dispatch.py",
line 465, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/util.py", line
401, in check
return func(*args, **kwargs)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/extensions.py",
line 116, in wrap
util.checksignature(origfn), *args, **kwargs)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/util.py", line
401, in check
return func(*args, **kwargs)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/hgext/mq.py", line
2648, in mqcommand
return orig(ui, repo, *args, **kwargs)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/util.py", line
401, in check
return func(*args, **kwargs)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/commands.py",
line 708, in commit
node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/cmdutil.py",
line 1150, in commit
return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/commands.py",
line 706, in commitfunc
editor=e, extra=extra)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/hgext/mq.py", line
2558, in commit
editor, extra)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/localrepo.py",
line 858, in commit
ret = self.commitctx(cctx, True)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/localrepo.py",
line 905, in commitctx
changed)
File
"/u/int5sys/opt/mercurial-1.5/lib/python2.6/site-packages/mercurial/localrepo.py",
line 734, in _filecommit
self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev)))
TypeError: b2a_hex() argument 1 must be string or read-only buffer, not None
|