gpt4 book ai didi

python - 'hg strip' 创建的补丁已损坏

转载 作者:行者123 更新时间:2023-11-28 20:53:32 25 4
gpt4 key购买 nike

我使用 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!

那么如何解决节点问题呢?

海因里希

最佳答案

来自 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.

这个简单的演示 session 说明了 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

关于python - 'hg strip' 创建的补丁已损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4304055/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com