1
votes

I don't really know how to search for this question so please direct me if it has already been asked.

I'm new to mercurial and we have a problem with our current repo organization:

Our current repo organization is that we each have our own working repositories (for each project) that we pull and push to a master repo (also for each project).

The problem is that our working repos are located on the company server (along with the master repo) and building from our working repo on the server is causing our build times to be exceedingly high (i.e. 40-50 seconds when building on our local hard drive takes about 1 second).

The obvious solution seems to be to move our working repos to our local hard drive and to push/pull to and from the master repo on the server.

One issue with this is that the working repo is now physically on our local hard disk and won't be backed up on the company server.

Is there a way to create a "shadow" working repo (located on the server side) that will permanently remain synced to each of our individual working repos (located on our local hard disk), and then push/pull from one of these to and from the master repo?

This way we will benefit from the reduced build times in addition to having all data from our working repos backed up on the server.

Thanks for any input/advice, Shaun

2
I'm not sure if it is clear, I mean a "shadow" working repo on the server for each user's working repo on their local drive.Shaun
mercurial is not centralized, there is no difference between the "working" repo and the "master" record.Emanuele Paolini
I'm not sure that I understand, I am new to mercurial and did not set up the repos.Shaun
I'm not sure that I understand, I am new to mercurial and did not set up the repos. In each project we have our own repos and a repo that we both use (my manager and I) as a "master".Shaun
for the working directory to be backed up in server you may use other tools unrelated to mercurial, like rsync, and have your "shadow" copy backed uparhak

2 Answers

1
votes

Generally you can only exchange committed changesets among repositories. Additionally they have to be of at least phase draft. There is no way inside mercurial to share the state of the working directory.

You probably want to get used to committing often and atomically. You can make it easily automatic to push every commit you make locally to the central server by means of commit hook.

Additionally you probably should consider to make your central server a non-publishing server. That means that you can push commits in draft phase and they will remain in that phase, thus mutable. That way you can also push draft work there which can later be edited. You'll have to change manually phase to public on those changesets which you consider 'done'. The changeset evolution extension of mercurial might come in handy

0
votes

You keep a copy of the repository on the company server (so that it will be backed up) and a copy on your local drive (so that you can compile it easily). You keep the copies in sync with push/pull.