Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial - hg update to a specific date on a named branch

I'm am currently working on a project which has several mercurial repositories. Each mercurial repository contains the source code for either a library or a binary, all of which are being actively developed.

You can imagine that compatability between products created from each repository can quickly become a problem. One way to relieve this problem is to update each local repository to be on compatible branches and then update to a particular date on these branches - with the view that at any point in time the branches were compatible.

On a named branch, say V0.X, at V0.1 tag

hg identify

gives

934ad264137e (V0.X) V0.1

Then update to a particular date ( I still want to stay on the V0.X branch )

hg update -d "<10/28/11"

now identify

hg identify; hg branch

gives

51a072771de7 tip
default    

Does anyone know how to update along a named branch to a date without the danger of jumping off to another branch?

Any help would be appreciated.

Jon.

like image 484
Jon Chambers Avatar asked Nov 04 '22 12:11

Jon Chambers


1 Answers

hg help revset
"branch(string or set)"
  All changesets belonging to the given branch or the branches of the
  given changesets.

...

"date(interval)" Changesets within the interval, see "hg help dates".

give us workflow like

  • hg log -r "branch('V0.X') and sort(date('<10/28/11'), date)"
  • find revision N in list
  • hg update -r N
like image 81
Lazy Badger Avatar answered Nov 09 '22 14:11

Lazy Badger