与Mercurial合并无关存储库中的提示 [英] Merge tip from an unrelated repository with Mercurial

查看:77
本文介绍了与Mercurial合并无关存储库中的提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不相关的存储库"public"和"develop":

I have two unrelated repositories 'public' and 'develop':

prj/
  public/
  develop/

'develop'有很多提交,'因为这里是我工作的地方.甚至连多个脑袋 我不时要发布开发资料库的快照.

'develop' has lots of commits, 'cause here is where I work. Maybe even multiple heads From time to time I want publish a snapshot of the development repository.

在公用文件夹中,我可以这样做:

From the public folder I could do this:

>hg pull -f ../develop
>hg merge
>hg commit -m "alpha2"

但这也会将完整的变更集历史从开发"拉到公开"(这不是我想要的).

But this will also pull the complete changeset history from 'develop' to 'public' (which is not what I want).

除了".hg"子文件夹,我还可以删除公共"中的所有文件. 然后从"develop"目录中手动复制所有文件并执行

I could also delete all files from 'public', except for the '.hg' subfolder. Then manually copy all files from the 'develop' directory and do a

>hg commit -m "alpha2"

但是然后我必须添加"新文件,删除"过时的文件并重新命名"已移动的文件.

But then I have to 'add' new files, 'remove' obsolete files and 'rename' moved files again.

在提交中使用-A选项会盲目添加/删除所有文件,即使它们在开发"存储库中不受控制也是如此.

Using the -A option with commit would blindly add/remove all files, even if they were uncontrolled in the 'development' repository.

必须有一种更有效的方法;-)

There must be a more efficient way to do this ;-)

推荐答案

我建议您浏览整个历史记录,但是如果由于某些原因您不能忍受,则可以执行以下任何操作:

I'd suggest you just move over the full history, but if you can't stomach that for some reason then you could do any of these things:

  1. 使用连接变更集,将所有变更集从开发变成单个结果变更集公开 -or-
  2. 公开删除所有文件,在开发中制作一个"hg存档",然后在公共场合扩展它-这样一来,您只能控制文件-或
  3. 在开发中使用'hg manifest'来使xargs移至只需要 -or-
  4. 的文件
  5. 在development中进行"hg diff -r last-changeset-in-public -r tip",然后在公共场合使用"hg import"应用所得的diff,您将在单个变更集中拥有完整的变更公开
  1. use ConcatenatingChangesets to join all the changesets from develop into a single resulting changeset in public -or-
  2. delete all files in public, make a 'hg archive' in develop, and expand it in public -- that will get you controlled files only -or
  3. use 'hg manifest' in develop to power xargs to move over only files you want -or-
  4. do a 'hg diff -r last-changeset-in-public -r tip' in develop, and then apply that resulting diff using 'hg import' in public and you'll have the full changes as a single changeset in public

其中任何一个都应该做同样的事情,但是它们都有些丑陋,因为总的来说,舍弃历史是很难做到的.

Any of those should do the same thing, but all of them are a little ugly because, in general, throwing away history is hard to do.

这篇关于与Mercurial合并无关存储库中的提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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