【问题标题】:Mercurial Queues - backing up and sharing uncommitted patchesMercurial Queues - 备份和共享未提交的补丁
【发布时间】:2012-12-10 07:48:49
【问题描述】:

我正在尝试了解如何将我的 mercurial 补丁推送到远程仓库(例如 bitbucket.org),而无需先应用它们(实际上是提交它们)。我的动机是在完成之前首先对我的工作进行远程备份,并且能够与其他人共享这些补丁或在不同的机器上处理它们。

我的正常工作流程是这样的:

$ hg qnew some-feature -m "work on some feature"

... work on some files

$ hg qref

--> bug or other feature request comes along

$ hg qpop some-feature
$ hg qnew new-feature -m "work on different feature"
... work on new stuff
$ hg qref

此时,我想将我未完成的、未提交的补丁推送到 repo。我已经读过 Mercurial 队列实际上是它们自己的存储库,因此可以像普通的 hg 存储库一样进行操作,但我不清楚我正在尝试做什么的工作流程。我在我的 shell 中将 mq 命令别名为 hg -R $(hg root)/.hg/patches,但我希望能得到一些关于人们如何管理远程备份和共享未提交补丁的反馈。谢谢。

【问题讨论】:

    标签: mercurial repository patch sharing mercurial-queue


    【解决方案1】:

    在 Bitbucket 上,您可以创建存储库和补丁队列。 Bitbucket 似乎还没有为补丁队列提供详细的official documentation,但是有一个blog post 描述了如何使用它们。

    要备份/共享未提交的补丁,基本的工作流程命令是:

    hg init --mq # initialize .hg/patches as a versioned repository (hereafter referred to as the MQ repository)
    # manually configure .hg/patches/.hg/hgrc to contain a [paths] section if desired
    hg commit --mq # commit in the MQ repository
    hg push --mq # push the MQ repository to default remote
    hg pull --mq # pull the MQ repository from default remote
    hg update --mq/hg merge --mq # same as normal for hg, but operating on the MQ repository
    

    在旧版本的 Mercurial 中,hg init --mqhg commit --mq 命令以 hg qinithg qcommit 的形式提供(现已弃用)。

    【讨论】:

      【解决方案2】:
      • hg push --mq 在 MQ 中推送变更集补丁
      • mqcollab - 轻松交换和协作 MQ 补丁

      【讨论】:

        【解决方案3】:

        您可以在.hg/patches 中创建一个存储库并将其作为单独的存储库推送。在更高版本的 mercurial 中,您只需执行 hg ci --mq,它将提交您的补丁存储库的最新版本。提交后,您可以将其克隆到 bitbucket。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-04-13
          • 1970-01-01
          • 2012-09-05
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多