Mercurial工作流程处理突发的高优先级任务

发布于 2024-08-31 17:02:01 字数 921 浏览 5 评论 0原文

场景是,我一天早上上班并拉取、更新、合并我的 Mercurial 树。从现在最新的修订版开始,我开始处理今天的任务。我达到了一个逻辑里程碑并进行了提交。这棵树现在看起来像这样:

*  <- my first commit for the day
|
*  <- merge commit from shared repos by team

现在老板出现了,发生了一些可怕的事情,需要我立即关注。他希望尽快推出解决方案。

我今天的计划被打乱了。使用 Mercurial 解决这个问题的最佳方法是什么?

  • 我可以编写解决方案并进行另一次提交,然后进行推送。但这很糟糕,因为该提交将以我自己的第一次提交作为父提交,从而推送不完整的代码。
  • 在一个完美的世界中,也许我编码的新功能将在它自己的分支中。但它是一个小功能,而且我很懒,所以它目前位于 default 中。我可以尝试找到一种方法将提交从一个分支移动到另一个分支。
  • 我可以忽略惊慌失措的老板,再进行两到三个提交来完成该功能,推送它,然后开始修复,将它们作为单独的提交和推送。

这些都感觉不好。我想要一些类似的东西:

  1. 进行更新,让我回到合并提交。
  2. 进行修复并提交。
  3. 仅推送修复提交,而不完整功能提交仍未推送。

因此,历史是这样的:

*  <- fix commit (pushed)
|
| *  <- my first commit for the day (unpushed)
|/
*  <- merge commit from shared repos by team

我们刚刚在办公室迁移到 Mercurial,这是我想要解决的一个问题。这里有哪位善变的大师愿意分享一些智慧吗?

The scenario is that I arrive at work one morning and pull, update, merge my mercurial tree. From the now latest revision I begin working on todays task. I reach a logical milestone and does a commit. The tree now looks like this:

*  <- my first commit for the day
|
*  <- merge commit from shared repos by team

Now the boss comes along, something horrible has happened and it needs my immediate attention. He wants the solution pushed asap.

My plan for the day is disrupted. What is the best way to use mercurial to tackle this problem?

  • I could just write the solution and make another commit followed by a push. But this is bad since that commit would have my own first commit as parent, thus pushing incomplete code.
  • In a perfect world maybe that new feature Im coding will be in its own branch. But its a small feature and Im lazy, so it currently resides in default. I could try to find a way to move a commit from one branch to another.
  • I could ignore the panicking boss, do two or three more commits to complete the feature, push that and then start working on the fix, bringing those in as a separate commit and push.

Neither of those feels good. I would like something along the lines of:

  1. Do an update, bringing me back to the merge commit.
  2. Do the fix and commit it.
  3. Push only the fix commit, leaving the incomplete-feature commit still unpushed.

Thus making the history like this:

*  <- fix commit (pushed)
|
| *  <- my first commit for the day (unpushed)
|/
*  <- merge commit from shared repos by team

We've just migrated to mercurial here at the office, and this is one problem I would like to tackle. Any mercurial gurus here that mind sharing some wisdom?

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

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

发布评论

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

评论(1

撩动你心 2024-09-07 17:02:01

您描述的工作流程看起来不错(更新以合并、提交、push -r 修复)。如果您对匿名分支感到不舒服,您可以首先克隆 -r 存储库以进行合并、提交和推送。

The workflow you're describing looks good (update to merge, commit, push -r the fix). If you feel not comfortable with anonymous branches, you can first clone -r the repo up to the merge, commit and push.

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