Update on central server

Martin Geisler mg at aragost.com
Tue Nov 2 07:21:01 CDT 2010


perico2009 <basura at tualbum.es> writes:

> Good day everybody,
>
> I have a newbie question. I am running mercurial with another 2
> developers. We have a central server hosted in a private network where
> we do commit all the changes. Everything works great, we develop in
> our individual computers and from time to time we do push to the
> central server. Problem is that when I do logn using ssh to the
> central server and go to mercurial folder where the project is
> allocated, I don't see the new files we have pushed listed in the
> server. But when we do pull any new changsets from the central server,
> the files are correctly downloaded and updated in our individual
> computers.

Yes -- when you push to a repository, the working copy is not changed.
This is just like when you pull: you only add changesets to the history
and have to use 'hg update' to make them affect the working copy
afterwards.

> I know that mercurial stores all the file additions and changes made
> to the project, and that is probably the reason why all this works
> perfectly, but I have doubts about if I need to do an hg update in the
> central server or leave it as it is?

Just leave it. Technically, the server repository has checked out the
special 'null' changeset that is completely empty. This is the changeset
that is a parent to revision 0. You can check it out yourself

  hg update null  # <- empty working copy
  hg update       # <- files are back

On a server where nobody will look at the files you don't have to waste
disk space on building and maintaining a working copy and so the null
revision is what you want.


If you some day do want to see the files in the working copy when you
push, then install this hook on the server:

  [hooks]
  changegroup = hg update

That will run 'hg update' on the server when you push to it.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial mailing list