view tests/test-rebase-detach.t @ 12619:7178f6fedb9d

cat: fix cat without -r, broken by 0ae35296fbf4 The default revision for revsingle() is now '.' instead of None. This preserves the behavior of cat prior to it using revsingle().
author Brodie Rao <brodie@bitheap.org>
date Fri, 08 Oct 2010 14:02:23 -0500
parents 16b854cb80f1
children 6cc4b14fb76b
line wrap: on
line source

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > graphlog=
  > rebase=
  > 
  > [alias]
  > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
  > EOF


  $ hg init a
  $ cd a

  $ echo A > A
  $ hg ci -Am A
  adding A

  $ echo B > B
  $ hg ci -Am B
  adding B

  $ echo C > C
  $ hg ci -Am C
  adding C

  $ echo D > D
  $ hg ci -Am D
  adding D

  $ hg up -q -C 0

  $ echo E > E
  $ hg ci -Am E
  adding E
  created new head

  $ cd ..


Rebasing D onto E detaching from C:

  $ hg clone -q -u . a a1
  $ cd a1

  $ hg tglog
  @  4: 'E'
  |
  | o  3: 'D'
  | |
  | o  2: 'C'
  | |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg rebase --detach -s 3 -d 4
  saved backup bundle to */.hg/strip-backup/*-backup.hg (glob)

  $ hg tglog
  @  4: 'D'
  |
  o  3: 'E'
  |
  | o  2: 'C'
  | |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg manifest
  A
  D
  E

  $ cd ..


Rebasing C onto E detaching from B:

  $ hg clone -q -u . a a2
  $ cd a2

  $ hg tglog
  @  4: 'E'
  |
  | o  3: 'D'
  | |
  | o  2: 'C'
  | |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg rebase --detach -s 2 -d 4
  saved backup bundle to */.hg/strip-backup/*-backup.hg (glob)

  $ hg tglog
  @  4: 'D'
  |
  o  3: 'C'
  |
  o  2: 'E'
  |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg manifest
  A
  C
  D
  E

  $ cd ..


Rebasing B onto E using detach (same as not using it):

  $ hg clone -q -u . a a3
  $ cd a3

  $ hg tglog
  @  4: 'E'
  |
  | o  3: 'D'
  | |
  | o  2: 'C'
  | |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg rebase --detach -s 1 -d 4
  saved backup bundle to */.hg/strip-backup/*-backup.hg (glob)

  $ hg tglog
  @  4: 'D'
  |
  o  3: 'C'
  |
  o  2: 'B'
  |
  o  1: 'E'
  |
  o  0: 'A'
  
  $ hg manifest
  A
  B
  C
  D
  E

  $ cd ..


Rebasing C onto E detaching from B and collapsing:

  $ hg clone -q -u . a a4
  $ cd a4

  $ hg tglog
  @  4: 'E'
  |
  | o  3: 'D'
  | |
  | o  2: 'C'
  | |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg rebase --detach --collapse -s 2 -d 4
  saved backup bundle to */.hg/strip-backup/*-backup.hg (glob)

  $ hg tglog
  @  3: 'Collapsed revision
  |  * C
  |  * D'
  o  2: 'E'
  |
  | o  1: 'B'
  |/
  o  0: 'A'
  
  $ hg manifest
  A
  C
  D
  E

  $ cd ..