views:

55

answers:

1

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 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?

+4  A: 

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:

  1. hg co central (making sure to abort if the working copy had uncommitted changes)
  2. rsync ssh://central/repo
  3. hg ci -m "snapshot of central on $(date)"

The push script would then be something like:

  1. ./pull
  2. hg co central
  3. hg merge <your working branch>
  4. ... test, fix any conflicts ...
  5. 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).

David Wolever