tests/test-rebase-bookmarks.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sun, 25 Dec 2011 20:35:16 +0900
changeset 15727 917f263eeb26
parent 14884 c0ccd70df52c
child 15742 65df60a3f96b
permissions -rw-r--r--
i18n: use "encoding.lower()" to normalize string in hgweb search query some problematic encoding (e.g.: cp932) uses ASCII alphabet characters in byte sequence of multi byte characters. "str.lower()" on such byte sequence may treat distinct characters as same one, and cause unexpected log matching. this patch uses "encoding.lower()" instead of "str.lower()" to normalize strings for compare.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     2
  > [extensions]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     3
  > graphlog=
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     4
  > rebase=
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     5
  > 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     6
  > [alias]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     7
  > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     8
  > EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     9
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    10
Create a repo with several bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    11
  $ hg init a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    12
  $ cd a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    13
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    14
  $ echo a > a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    15
  $ hg ci -Am A
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    16
  adding a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    17
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    18
  $ echo b > b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    19
  $ hg ci -Am B
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    20
  adding b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    21
  $ hg book 'X'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    22
  $ hg book 'Y'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    23
 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    24
  $ echo c > c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    25
  $ hg ci -Am C
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    26
  adding c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    27
  $ hg book 'Z'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    28
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
  $ hg up -q 0
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    30
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    31
  $ echo d > d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    32
  $ hg ci -Am D
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    33
  adding d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    34
  created new head
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    35
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    36
  $ hg tglog 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    37
  @  3: 'D' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    38
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    39
  | o  2: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    40
  | |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    41
  | o  1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    42
  |/
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    43
  o  0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    44
  
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    45
 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    46
Move only rebased bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    47
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    48
  $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    49
  $ hg clone -q a a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    50
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    51
  $ cd a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    52
  $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    53
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    54
  $ hg rebase --detach -s Y -d 3
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    55
  saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    56
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    57
  $ hg tglog 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    58
  @  3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    59
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    60
  o  2: 'D' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    61
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    62
  | o  1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    63
  |/
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    64
  o  0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    65
  
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    66
Keep bookmarks to the correct rebased changeset
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    67
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    68
  $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    69
  $ hg clone -q a a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    70
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    71
  $ cd a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    72
  $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    73
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    74
  $ hg rebase -s 1 -d 3
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    75
  saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    76
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    77
  $ hg tglog 
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    78
  @  3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    79
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    80
  o  2: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    81
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    82
  o  1: 'D' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    83
  |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    84
  o  0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    85