Mercurial: pull changes from unversioned copy
I am currently maintaining a Mercurial repository of the project I am working on.
The rest of the team, however, doesn't.
There is a "good" (unversioned) copy of the code base that I can access by SSH. What I would like to do is be able to do something like an hg pull
from that good copy into my master repository whenever it gets updated.
As far as I can tell, there's no obvious开发者_C百科 way to do this, as hg pull
requires you have a source hg repository.
I suppose I could use a utility like rsync
to update my repository, then commit, but I was wondering:
Is there was an easier/less contrived way to do this?
In short: not that I know of.
If I were in your position, though, I'd keep the "central" code in one branch, do my dev in another branch, then have scripts which would push/pull as appropriate.
For example, the pull script would:
hg co central
(making sure to abort if the working copy had uncommitted changes)rsync ssh://central/repo
hg ci -m "snapshot of central on $(date)"
The push script would then be something like:
./pull
hg co central
hg merge <your working branch>
- ... test, fix any conflicts ...
rsync . ssh://central/repo
Finally, I would apply clue stick liberally until the rest of the team is on board :) (although you probably knew that already).
精彩评论