bookmark: add a dedicated txnclose-bookmark hook
The new 'txnclose-bookmark' hook expose the bookmark movement information stored in 'tr.changes['bookmarks]'. To provide a simple and straightforward hook API to the users, we introduce a new hook called for each bookmark touched. Since a transaction can affect multiple bookmarks, updating the existing 'txnclose' hook to expose that information would be more complex. The data for all moves might not fit in environment variables and iterations over each move would be cumbersome. So the introduction of a new dedicated hook is preferred in this changeset. This does not exclude the addition to the full bookmark information to the existing 'txnclose' in the future to help write more complex hooks.
Showing
- mercurial/bookmarks.py 9 additions, 0 deletionsmercurial/bookmarks.py
- mercurial/help/config.txt 12 additions, 0 deletionsmercurial/help/config.txt
- mercurial/localrepo.py 13 additions, 4 deletionsmercurial/localrepo.py
- tests/test-bookmarks-pushpull.t 23 additions, 7 deletionstests/test-bookmarks-pushpull.t
- tests/test-bookmarks.t 21 additions, 8 deletionstests/test-bookmarks.t
Loading
Please register or sign in to comment