Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial command to combine hg pull; hg up

Tags:

pull

mercurial

How can I combine the Mercurial commands hg pull and hg update into one?

like image 754
Petrus Theron Avatar asked Mar 06 '13 07:03

Petrus Theron


2 Answers

Obviously, hg pull -u is the answer here.

However, there's a caveat that deserves mentioning: hg pull -u is not exactly equivalent to hg pull && hg update. This is briefly mentioned in the documentation, but it can be surprising if you first run into it; if there's nothing to pull (e.g. no new changesets came in), then hg pull -u doesn't update. This can be slightly confusing if you weren't on a head before issuing the command.

like image 97
djc Avatar answered Sep 20 '22 16:09

djc


type hg help pull and you will see the -u switch

like image 23
adrianm Avatar answered Sep 22 '22 16:09

adrianm