[Bug 6086] New: In-memory rebase still calls update hooks, but not preupdate hooks

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Feb 21 01:55:54 EST 2019


https://bz.mercurial-scm.org/show_bug.cgi?id=6086

            Bug ID: 6086
           Summary: In-memory rebase still calls update hooks, but not
                    preupdate hooks
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: rebase
          Assignee: bugzilla at mercurial-scm.org
          Reporter: hg at pewpew.net
                CC: mercurial-devel at mercurial-scm.org

Here's a .t file showing the issue; the in-memory rebase runs update hooks (not
sure why), but doesn't run preupdate hooks.  It should probably run both or
neither?

  $ cat > preupdate.sh <<EOF
  > #!/bin/bash
  > echo preupdate >> $TESTTMP/update_hooks.txt
  > EOF
  $ cat > update.sh <<EOF
  > #!/bin/bash
  > echo update >> $TESTTMP/update_hooks.txt
  > EOF
  $ chmod +x preupdate.sh update.sh

  $ cat >> $HGRCPATH <<EOF
  > [experimental]
  > evolution.createmarkers=True
  > evolution.allowunstable=True
  > [extensions]
  > rebase=
  > [hooks]
  > preupdate.does_it_work=$TESTTMP/preupdate.sh
  > update.does_it_work=$TESTTMP/update.sh
  > EOF
  $ hg init a
  $ cd a
  $ echo r0 > file.txt
  $ hg ci -qAm 'r0'
  $ echo r1 > file.txt
  $ hg ci -qAm 'r1'
  $ echo r2 > file.txt
  $ hg ci -qAm 'r2'
  $ hg co -qr 0

no inmemory rebase:
  $ hg commit -q --amend -m 'r0_amended' 're:^$'
  2 new orphan changesets
  $ rm $TESTTMP/update_hooks.txt
  $ hg rebase -qr 1::2 -d .
  $ cat $TESTTMP/update_hooks.txt
  preupdate
  update
  preupdate
  update
  preupdate
  update

with inmemory rebase:
  $ hg commit -q --amend -m 'r0_amended_again' 're:^$'
  2 new orphan changesets
  $ rm $TESTTMP/update_hooks.txt
  $ hg --config rebase.experimental.inmemory=1 rebase -qr 4::5 -d .
  $ cat $TESTTMP/update_hooks.txt
  update
  update

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list