推送秘密变更集 [英] Push secret changesets

查看:57
本文介绍了推送秘密变更集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这看起来很矛盾,我知道秘密变更集本来就是私有的,但是如果我想备份那些秘密变更集怎么办?

我并行处理一些分支,有时我想推送一个而不是其他.为此,我在单独的克隆中工作,但我对此感到讨厌.

因此,现在汞变具有阶段性,我可以建立秘密分支并将所有内容都存储在同一存储库中.问题是,在secret分支的开始及其发布之间,我想备份那些秘密的变更集(我在另一台计算机上有一个克隆,目的是为了保存备份,以防本地仓库或计算机发生某些情况).

有没有办法做到这一点,或者我的工作流程完全错误?

解决方案

似乎阶段仍然相对较新,并且似乎尚未包括某些工作流(例如此).自2013年3月19日起,我相信唯一的方法是手动将阶段从秘密更改为公开.

您可以从命令行使用以下命令:

for /f "delims=" %a in ('hg log --template "{rev} " -r "secret()"') do @set secret=%a
hg phase -d %secret%
hg push -f
hg phase -sf %secret%

这不会更改您要推送到的存储库上的秘密提交,我试图更改推送来做到这一点(但未成功):

hg push -f --remotecmd hg phase -sf %secret%

为了使remote hg command起作用,提交必须完全匹配,但是无论如何我都无法在远程存储库上进行更改.

================================================ ============

如果要使用TortoiseHG Workbench之类的GUI,您现在必须手动完成所有操作(更改要在任何存储库上的GUI中的阶段).抱歉,希望我们能尽快找到更好的解决方案!

That may look paradoxical, I know that secret changesets are meant to be private, but what if I want to backup those secret changesets?

I work with some branches in parallel and sometimes I want to push one, but not the others. To achieve that, I work in separate clones but I hate that.

So now mercurial has phases, I can make secret branches and have everything in the same repository. The problem is that between the beginning of the secret branch and its publication, I want to backup those secret changesets (I have a clone in another machine just to hold my backups in case something happens with my local repo or my machine).

Is there a way of doing that or my workflow is completly wrong?

解决方案

It seems like phases are still relatively new and some workflows, such as this, don't seem to be included, yet. As of 2013-03-19, I believe the only way you can do this is manually changing the phases from secret to public.

You can use these commands from the command line:

for /f "delims=" %a in ('hg log --template "{rev} " -r "secret()"') do @set secret=%a
hg phase -d %secret%
hg push -f
hg phase -sf %secret%

This doesn't change the commits to secret on the repository you are pushing to, I tried to change the push to do this (but was unsuccessful):

hg push -f --remotecmd hg phase -sf %secret%

The commits would have to match exactly for the remote hg command to work, but I couldn't get it to change on the remote repository anyway.

============================================================

If you want to use a GUI like TortoiseHG Workbench you will have to do this all manually (change the phases in the GUI on any repositories you want to) at the moment. Sorry, and hopefully, we can find a better solution, soon!

这篇关于推送秘密变更集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆