0

I use a bookmark based development approach and have various scripts written to help me do this. I'd like to run one of these scripts after updating to a new bookmark. I've added an update hook, but this seems to run before the bookmark has been changed:

$ hg update new-bookmark
$ <SCRIPT RUNS>
$ (activating bookmark new-bookmark) 

How do I add a hook which will run after the current bookmark has been updated?

Martyn
  • 16,432
  • 24
  • 71
  • 104

1 Answers1

0

Your testing just wrong. update-hooks performed after new changeset become active

Test-case

>hg log -T "{rev}:{node|short}\n"
2:e37c7be131f2
1:ef24a87ada3d
0:a8219c43c17e

Hooks section of repo's .hgrc

[hooks]
update.UpHook = echo Update hook: && hg id -in
preupdate.preUpHook = echo PreUpdate hook: && hg id -in

Testing

>hg id -in
a8219c43c17e 0

>hg up 2
PreUpdate hook:
a8219c43c17e 0
Update hook:
e37c7be131f2 2
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110