我有一个Mercuirial(3.6.1)项目。每次我尝试提交时,我都会收到下一个错误。
(project)➜ project hg:(default) ✗ hg commit -m "TICK-190" subfolder/models.py
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2]
** Mercurial Distributed SCM (version 3.6.1)
** Extensions loaded:
Traceback (most recent call last):
File "/home/django/project/bin/hg", line 43, in <module>
mercurial.dispatch.run()
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 54, in run
sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 116, in dispatch
ret = _runcatch(req)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 187, in _runcatch
return _dispatch(req)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 920, in _dispatch
cmdpats, cmdoptions)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 679, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/home/django/plantbid/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 1051, in _runcommand
return checkargs()
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 1011, in checkargs
return cmdfunc()
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/dispatch.py", line 917, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/util.py", line 801, in check
return func(*args, **kwargs)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/commands.py", line 1584, in commit
node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/cmdutil.py", line 2491, in commit
return commitfunc(ui, repo, message, matcher, opts)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/project.py", line 1578, in commitfunc
extra=extra)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 64, in wrapper
return orig(repo.unfiltered(), *args, **kwargs)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/localrepo.py", line 1550, in commit
allowemptycommit = (wctx.branch() != wctx.p1().branch()
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/context.py", line 533, in branch
return encoding.tolocal(self._changeset[5].get("branch"))
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/util.py", line 534, in __get__
result = self.func(obj)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/context.py", line 502, in _changeset
return self._repo.changelog.read(self.rev())
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/changelog.py", line 338, in read
text = self.revision(node)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/revlog.py", line 1110, in revision
bins = self._chunks(chain, df=_df)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/revlog.py", line 1015, in _chunks
self._chunkraw(revs[0], revs[-1], df=df)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/revlog.py", line 990, in _chunkraw
return self._getchunk(start, length, df=df)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/revlog.py", line 981, in _getchunk
return self._loadchunk(offset, length, df=df)
File "/home/django/project/local/lib/python2.7/site-packages/mercurial/revlog.py", line 966, in _loadchunk
return util.buffer(d, offset - realoffset, length)
ValueError: size must be zero or positive
我可以解释的细节不多。我提交我的代码没有问题,突然间这个错误开始出现。我无法提交任何文件。我可以毫无问题地询问gor hg状态。
由于这是我最近获得的遗留项目,我希望尽可能少地做出改变。
更新:
hg verify
repository uses revlog format 1
checking changesets
changelog@?: data length off by 1066185 bytes
changelog@?: rev 6801 points to nonexistent changeset -1
(expected 6801)
6802: unpacking changeset b087b38d690d: revlog decompress error: Error -5 while decompressing data: incomplete or truncated stream
checking manifests
manifest@?: data length off by 1894563 bytes
manifest@?: rev 6729 points to nonexistent changeset -1
manifest@?: 000000000000 not in changesets
manifest@?: rev 6730 points to unexpected changeset 6802
manifest@?: 9363dc75d5fb not in changesets
?: reading manifest delta 9363dc75d5fb: revlog decompress error: Error -5 while decompressing data: incomplete or truncated stream
crosschecking files in changesets and manifests
checking files
plantbid/templates/rfp_edit_nursery_responses3.html@?: rev 8 points to unexpected changeset 6802
(expected )
plantbid/templates/rfp_edit_nursery_responses3.html@?: 7e15c24e6859 not in manifests
plantrfp/views.py@4684: broken revlog! (index data/plantrfp/views.py.i is corrupted)
warning: orphan revlog 'data/plantrfp/views.py.i'
2266 files, 6803 changesets, 13181 total revisions
3 warnings encountered!
12 integrity errors encountered!
(first damaged changeset appears to be 4684)
答案 0 :(得分:2)
您可能在Mercurial中发现了一个错误,但在提交错误报告之前,请先尝试更新到最新的Mercurial版本(3.9)。 https://www.mercurial-scm.org
Re:更新:看起来您的存储库有问题。也许您的硬盘有错误?这是存储库的唯一副本,还是在其他地方还有另一个副本?你最好的选择可能是尝试找到一个没有破损的副本。