简体   繁体   English

在mercurial中,如何捆绑我的最新提交并将它们标记为已捆绑

[英]In mercurial how do I bundle my latest commits and mark them as already bundled

From a Mercurial repository I want to regularly create a bundle with all my latest commits (in order to email them). 在Mercurial存储库中,我想定期创建一个包含所有最新提交的包(以便通过电子邮件发送)。

Starting with a clean directory I envision a process like this: 从一个干净的目录开始,我想象一个这样的过程:

  1. create a clean repository 创建一个干净的存储库
    work on my directory 在我的目录上工作
    commit 承诺
    work more in directory 在目录中工作更多
    commit 承诺
    ... ...

  2. send a bundle with the commits. 发送提交包。

  3. work on my directory 在我的目录上工作
    commit 承诺
    work more in directory 在目录中工作更多
    commit 承诺
    ... ...

  4. send a bundle with the all commits after the last sent bundle . 在最后发送的包之后发送包含所有提交的包

  5. go back to 2. 回到2。

How can I do this? 我怎样才能做到这一点? The problem is step 4. Is there a way to mark all bundled commits (in order to not bundle them again)? 问题是第4步。有没有办法标记所有捆绑的提交(为了不再捆绑它们)?


Note: Together all the bundles I sent per email should make up the complete directory in its current state. 注意:我每封电子邮件发送的所有捆绑包应该组成当前状态的完整目录。

There is no built-in mechanism for this in Mercurial. Mercurial中没有内置机制。 What you want to do is to specify the correct base changeset when you generate a new bundle. 您要做的是在生成新捆绑包时指定正确的基本变更集。 That is, in Step 4, you want to run 也就是说,在步骤4中,您想要运行

$ hg bundle --base head-used-in-step-2 changes-after-2.hg

You can do the bookkeeping in different ways: teach your parrot to remember the last bundled commit, write it on a post-it note, write the commit into an untracked file in the repository, or track it using a local tag. 您可以通过不同方式进行簿记:教您的鹦鹉记住最后一次捆绑提交,将其写在便利贴上,将提交写入存储库中未跟踪的文件,或使用本地标记跟踪它。

Using a local tag is probably the best way. 使用本地标签可能是最好的方法。 After you create a new bundle you move the tag to the working copy parent revsion: 创建新捆绑包后,将标记移动到工作副本父版本:

$ hg bundle --base last-bundle
$ hg tag --local -f last-bundle

You need -f since you will be moving the tag. 你需要-f因为你将移动标签。 You wont have the last-bundle tag the first time you bundle, so just use hg bundle --all the first time. 你第last-bundle不会有last-bundle标签,所以只需要使用hg bundle --all第一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM