'hg 条'创建的补丁已损坏

发布于 2024-10-05 12:35:26 字数 1205 浏览 0 评论 0原文

我使用 hg strip 从我的历史记录中删除了一些提交。 现在我想重新应用在 strip 命令期间作为备份制作的补丁: .hg/strip-backup/68a8f24f62d0-backup.hg

不幸的是,当我尝试推送补丁时,补丁似乎已损坏:

$:~/sc2$ hg init --mq
adding .hg/patches/68a8f24f62d0-backup.hg
68a8f24f62d0-backup.hg: up to 582 MB of RAM may be required to manage this file
(use 'hg revert 68a8f24f62d0-backup.hg' to cancel the pending addition)
$:~/sc2$ hg qpush
applying 68a8f24f62d0-backup.hg
patch 68a8f24f62d0-backup.hg is empty
transaction abort!
rollback completed
cleaning up working directory...done
abort: decoding near 'h91AY&SY݁��S������': 'utf8' codec can't decode byte 0xb1 in position 16: invalid start byte!

有人已经遇到此问题或者可以给我建议如何应用补丁吗?如果不可能的话,我就完蛋了……

也许这是一个Python问题?

我尝试了 hg unbundle 并得到了这个:

adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: received file revlog group is empty

如果我执行 hg pull:

pulling from 68a8f24f62d0-backup.hg
searching for changes
adding changesets
transaction abort!
rollback completed
abort: data/sc2-local.tar.i@2cad29d699f8: no node!

那么如何解决节点问题?

海因里希

I used hg strip to remove some commits from my history.
Now I want to reapply the patch that was made as backup during the strip command: .hg/strip-backup/68a8f24f62d0-backup.hg

Unfortunately when I try to push the patch, it seems that the patch is corrupted:

$:~/sc2$ hg init --mq
adding .hg/patches/68a8f24f62d0-backup.hg
68a8f24f62d0-backup.hg: up to 582 MB of RAM may be required to manage this file
(use 'hg revert 68a8f24f62d0-backup.hg' to cancel the pending addition)
$:~/sc2$ hg qpush
applying 68a8f24f62d0-backup.hg
patch 68a8f24f62d0-backup.hg is empty
transaction abort!
rollback completed
cleaning up working directory...done
abort: decoding near 'h91AY&SY݁��S������': 'utf8' codec can't decode byte 0xb1 in position 16: invalid start byte!

Has someone had this problem already or can give me an advice how to apply the patch? If it is not possible I am more than screwed ...

Maybe this is a python problem?

I tried hg unbundle and get this:

adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: received file revlog group is empty

If I do hg pull:

pulling from 68a8f24f62d0-backup.hg
searching for changes
adding changesets
transaction abort!
rollback completed
abort: data/sc2-local.tar.i@2cad29d699f8: no node!

So how can I fix the node problem?

Heinrich

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情深缘浅 2024-10-12 12:35:27

hg help strip 的输出:

任何剥离的变更集都存储在“.hg/strip-backup”中...可以通过运行“hg unbundle .hg /strip-backup/BUNDLE”来恢复它们,其中 BUNDLE 是由条带。

这个简单的演示会话演示了stripunbundle命令的使用:

# create a new repo and commit some changes:
$ hg init foobar
$ cd foobar/
$ echo a > file
$ hg ci -A -m "Initial"
adding file
$ echo b > file
$ hg ci -m "Change 1"
$ echo c > file
$ hg ci -m "Change 2"
$ hg glog --template '{rev} - {node} - {desc}\n'
@  2 - 86ecd06a38260fd229fdd73ba82efa6b2db0784c - Change 2
|
o  1 - 7827b4d5a10c2ca8d5196752f1b2dec92e8cf573 - Change 1
|
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# trash revision 1 and all its children:
$ hg strip 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to /path/to/foobar/.hg/strip-backup/7827b4d5a10c-backup.hg
$ hg log --template '{rev} - {node} - {desc}\n'
@ - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# meanwhile, make new changes:
$ hg ci -m "Change 1.1"
$ hg glog --template '{rev} - {node} - {desc}\n'
@  1 - a5ad2a79835ad0019f215e62fd928f8649cbbcab - Change 1.1
|
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# you decide your previous work was not that bad at all:
$ hg unbundle .hg/strip-backup/7827b4d5a10c-backup.hg
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
(run 'hg update' to get a working copy)

$ hg glog --template '{rev} - {node} - {desc}\n'
o  3 - 86ecd06a38260fd229fdd73ba82efa6b2db0784c - Change 2
|
o  2 - 7827b4d5a10c2ca8d5196752f1b2dec92e8cf573 - Change 1
|
| @  1 - a5ad2a79835ad0019f215e62fd928f8649cbbcab - Change 1.1
|/
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

From the output of hg help strip:

Any stripped changesets are stored in ".hg/strip-backup" ... They can be restored by running "hg unbundle .hg /strip-backup/BUNDLE", where BUNDLE is the bundle file created by the strip.

This simple demo session illustrates the use of the strip and unbundle commands:

# create a new repo and commit some changes:
$ hg init foobar
$ cd foobar/
$ echo a > file
$ hg ci -A -m "Initial"
adding file
$ echo b > file
$ hg ci -m "Change 1"
$ echo c > file
$ hg ci -m "Change 2"
$ hg glog --template '{rev} - {node} - {desc}\n'
@  2 - 86ecd06a38260fd229fdd73ba82efa6b2db0784c - Change 2
|
o  1 - 7827b4d5a10c2ca8d5196752f1b2dec92e8cf573 - Change 1
|
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# trash revision 1 and all its children:
$ hg strip 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
saved backup bundle to /path/to/foobar/.hg/strip-backup/7827b4d5a10c-backup.hg
$ hg log --template '{rev} - {node} - {desc}\n'
@ - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# meanwhile, make new changes:
$ hg ci -m "Change 1.1"
$ hg glog --template '{rev} - {node} - {desc}\n'
@  1 - a5ad2a79835ad0019f215e62fd928f8649cbbcab - Change 1.1
|
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial

# you decide your previous work was not that bad at all:
$ hg unbundle .hg/strip-backup/7827b4d5a10c-backup.hg
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files
(run 'hg update' to get a working copy)

$ hg glog --template '{rev} - {node} - {desc}\n'
o  3 - 86ecd06a38260fd229fdd73ba82efa6b2db0784c - Change 2
|
o  2 - 7827b4d5a10c2ca8d5196752f1b2dec92e8cf573 - Change 1
|
| @  1 - a5ad2a79835ad0019f215e62fd928f8649cbbcab - Change 1.1
|/
o  0 - 2b41b1e661196fe943125fdb1d590b5a60369c7e - Initial
打小就很酷 2024-10-12 12:35:27

我就这个主题与 Matt Mackall(Mercurial 主要作者)进行了一些接触,我们发现了 Mercurial 中的一个错误:

Mercurial 实际上无法处理大于 2^31-1 字节的文件,即 ~2GB,因为有符号整数是用于保存尺寸。但是,如果您添加较大的文件(我所做的),mercurial 不会拒绝它们,而是照常添加。对文件大小的唯一检查似乎是在推送到服务器时。然而,我在这里只收到了一个警告和一个永无止境的hg Push

马特·麦考尔 (Matt Mackall) 在邮件对话中引用的话:

这会导致一些溢出
地点:

a) 将第一个修订写入
revlog,我们将存储
未压缩大小以 2G 为模,但我们会
仍然能够成功读取
整个文件

b) 构建捆绑包时
传输或剥离,我们将
报告以 2G 为模的块大小,其中
将被解释为负数
数字,因此看起来像一个空的
块。

I had some contact with Matt Mackall (Primary Mercurial Author) on this topic and we figured out a bug in Mercurial:

Mercurial actually is not able to handle files larger than 2^31-1 Bytes, which are ~2GB, as signed ints are used for saving the size. However, if you add larger files (what I did) mercurial won't reject them but add as usual. The only check for the file size seems to be when pushing to the server. However, I only got a warning and a never ending hg push here.

Quote by Matt Mackall from the mail conversation:

It'll cause an overflow in a few
places:

a) when writing the first revision to
the revlog, we'll store an
uncompressed size modulo 2G, but we'll
still be able to successfully read the
whole file

b) when building the bundle for
transmission or stripping, we'll
report a chunk size modulo 2G, which
will be interpreted as a negative
number and thus look like an empty
chunk.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文