我在我的根目录上做了一个递归 sed,当我尝试提交,或者除了 hg --help 之外对 hg 做任何事情时,我得到一个堆栈跟踪。当我执行 sed 时,我错误地认为 .hg 目录是写保护的。
该仓库在我的机器上是本地的。
有什么方法可以让我恢复我的变更日志或提交评论?00changelog.i
我在目录中找到了一个名为的文件.hg
,但它是一个不执行的二进制文件。
sed 命令:
find . -type f -exec sed -i.bak "s/sim-config.h/config.h/g" {} \;
find . -type f -exec sed -i.bak "s/av-config.h/config.h/g" {} \;
堆栈跟踪:
Traceback (most recent call last):
File "/usr/bin/hg", line 27, in <module>
mercurial.dispatch.run()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 16, in run
sys.exit(dispatch(sys.argv[1:]))
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 30, in dispatch
return _runcatch(u, args)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 50, in _runcatch
return _dispatch(ui, args)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 470, in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 340, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 521, in _runcommand
return checkargs()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 475, in checkargs
return cmdfunc()
File "/usr/lib/python2.6/site-packages/mercurial/dispatch.py", line 469, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/mercurial/commands.py", line 712, in commit
node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
File "/usr/lib/python2.6/site-packages/mercurial/cmdutil.py", line 1151, in commit
return commitfunc(ui, repo, message, match(repo, pats, opts), opts)
File "/usr/lib/python2.6/site-packages/mercurial/commands.py", line 710, in commitfunc
editor=e, extra=extra)
File "/usr/lib/python2.6/site-packages/mercurial/localrepo.py", line 787, in commit
changes = self.status(match=match, clean=force)
File "/usr/lib/python2.6/site-packages/mercurial/localrepo.py", line 1015, in status
listclean, listunknown)
File "/usr/lib/python2.6/site-packages/mercurial/dirstate.py", line 614, in status
dmap = self._map
File "/usr/lib/python2.6/site-packages/mercurial/util.py", line 156, in __get__
result = self.func(obj)
File "/usr/lib/python2.6/site-packages/mercurial/dirstate.py", line 58, in _map
self._read()
File "/usr/lib/python2.6/site-packages/mercurial/dirstate.py", line 228, in _read
p = parsers.parse_dirstate(self._map, self._copymap, st)