English 中文(简体)
Sync files in Two Different Repos using HG
原标题:
  • 时间:2009-11-15 12:19:44
  •  标签:
  • mercurial

I ve got a problem when I try to sync files in two different repos. What I want to do is:

I ve got 2 repos A and B, and they share some common files, suppose they lie in A/docs/common/ and B/docs/common. So when I write some new docs in A and I want to update it to B or vice versa. How can I do?

I try this: I write a .hgignore in A to ignore the files I don t want to sync to B, and then try to hg push B s repo url. It doesn t work.

So how can I do this?

Thanks.

最佳回答

If I m reading it correctly and your repository roots are above the docs directory (test: hg root says /file/path not /file/path/A) Your current soln, ignoring the files outside of docs in both repos, won t work because mercurial tracks full file paths back to root, to A/ and B/ are part of your file paths so they re different in different the two repos making them separate repos.

One thing you could do is use Mercurial s sub-repository support to make docs a sub-repo that s "included" within both A and B. Then you can push/pull docs around and the separate, different parent repos will keep track of what point on docs they ve been updated to.

If I misread your original situation and A and B are just separate clones and docs is a top level directory with the same path in both repos (test: hg root is /file/path/A and file/path/B), then you ve got a totally normal mercurial situation that should be working. Just make sure you re commiting, pushing (or pulling), and updating and you should see changes migrate across.

问题回答

暂无回答




相关问题
Can I clone part of a Mercurial repository?

Is it possible to clone part of a Mercurial repository? Let s say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository? E.g. in ...

Sync files in Two Different Repos using HG

I ve got a problem when I try to sync files in two different repos. What I want to do is: I ve got 2 repos A and B, and they share some common files, suppose they lie in A/docs/common/ and B/docs/...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

git for mercurial like git-svn

Hello is there a tool for git that allow to work with mercurial repositories F.e. for svn there is a git-svn package, that allows to clone/commit/update from svn and work in a git way.. So is there ...

Useful Mercurial Hooks [closed]

What are some useful Mercurial hooks that you have come across? A few example hooks are located in the Mercurial book: acl bugzilla notify check for whitespace I personally don t find these very ...

热门标签