[issue1807] rebase calls too many hooks

Patrick Mézard mercurial-bugs at selenic.com
Sun Aug 23 10:40:39 CDT 2009


New submission from Patrick Mézard <pmezard at gmail.com>:

Here is a simple rebase run. I have changed hook.hook() to print the name of
the hooks being run, and kept the output only for the rebase call. All hooks
triggered from "hook preoutgoing" to "hook incoming" included come from the
internal bundle + strip calls, and are clearly unexpected in a rebase context.

For instance, people use the outgoing hook to prevent mq revisions to be
pushed, and such a hook is inadvertently triggered by a rebase operation.

    http://www.selenic.com/pipermail/mercurial-devel/2009-August/014790.html

I suggest we add a way to disable the strip() hooks and use it for rebase
and possibly other commands generating backups. What do you think?


----
$ hg init repo
$ cd repo
$ echo a > a
$ hg ci -Am t
adding a
$ echo b > b
$ hg ci -Am t
adding b
$ hg up -C 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo c > c
$ hg ci -Am addc
adding c
created new head
$ hg rebase -d 1
hook pre-rebase
hook preupdate
hook update
hook preupdate
hook update
hook precommit
hook pretxncommit
hook commit
hook preoutgoing
saving bundle to
/Users/pmezard/dev/mercurial/hg/tests/repo/.hg/strip-backup/4632a5a852af-temp
hook outgoing
adding branch
hook prechangegroup
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
hook pretxnchangegroup
hook changegroup
hook incoming
rebase completed
hook post-rebase

----------
messages: 10405
nosy: pmezard
priority: bug
status: unread
title: rebase calls too many hooks
topic: rebase

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://mercurial.selenic.com/bts/issue1807>
____________________________________________________



More information about the Mercurial-devel mailing list