tests/test-log-bookmark.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Mon, 30 Nov 2020 12:40:28 +0100
changeset 45981 53bde3ad0270
parent 45900 0aa118f18d4b
child 46041 9c0db3671008
permissions -rw-r--r--
upgrade: directly use the upgrade action constant This make the code simpler and will make it simpler to add more case in the future. Differential Revision: https://phab.mercurial-scm.org/D9467
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45900
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     1
Test 'hg log' with a bookmark
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     2
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     3
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     4
Create the repository
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     5
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     6
  $ hg init Test-D8973
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     7
  $ cd Test-D8973
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     8
  $ echo "bar" > foo.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
     9
  $ hg add foo.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    10
  $ hg commit -m "Add foo in 'default'"
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    11
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    12
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    13
Add a bookmark for topic X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    14
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    15
  $ hg branch -f sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    16
  marked working directory as branch sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    17
  (branches are permanent and global, did you want a bookmark?)
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    18
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    19
  $ hg bookmark sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    20
  $ hg up sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    21
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    22
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    23
  $ echo "X" > x.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    24
  $ hg add x.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    25
  $ hg commit -m "Add x.txt in 'sebhtml/99991-topic-X'"
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    26
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    27
  $ hg log -B sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    28
  changeset:   1:29f39dea9bf9
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    29
  branch:      sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    30
  bookmark:    sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    31
  tag:         tip
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    32
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    33
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    34
  summary:     Add x.txt in 'sebhtml/99991-topic-X'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    35
  
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    36
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    37
Add a bookmark for topic Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    38
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    39
  $ hg update default
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    40
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    41
  (leaving bookmark sebhtml/99991-topic-X)
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    42
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    43
  $ echo "Y" > y.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    44
  $ hg add y.txt
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    45
  $ hg branch -f sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    46
  marked working directory as branch sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    47
  $ hg bookmark sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    48
  $ hg up sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    49
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    50
  $ hg commit -m "Add y.txt in 'sebhtml/99992-topic-Y'"
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    51
  created new head
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    52
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    53
  $ hg log -B sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    54
  changeset:   2:11df7969cf8d
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    55
  branch:      sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    56
  bookmark:    sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    57
  tag:         tip
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    58
  parent:      0:eaea25376a59
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    59
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    60
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    61
  summary:     Add y.txt in 'sebhtml/99992-topic-Y'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    62
  
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    63
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    64
The log of topic Y does not interfere with the log of topic X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    65
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    66
  $ hg log -B sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    67
  changeset:   1:29f39dea9bf9
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    68
  branch:      sebhtml
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    69
  bookmark:    sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    70
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    71
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    72
  summary:     Add x.txt in 'sebhtml/99991-topic-X'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    73
  
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    74
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    75
Merge topics Y and X in the default branch
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    76
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    77
  $ hg update default
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    78
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    79
  (leaving bookmark sebhtml/99992-topic-Y)
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    80
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    81
  $ hg bookmark
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    82
     sebhtml/99991-topic-X     1:29f39dea9bf9
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    83
     sebhtml/99992-topic-Y     2:11df7969cf8d
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    84
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    85
  $ hg merge sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    86
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    87
  (branch merge, don't forget to commit)
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    88
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    89
  $ hg commit -m "Merge branch 'sebhtml/99992-topic-Y' into 'default'"
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    90
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    91
  $ hg update default
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    92
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    93
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    94
  $ hg merge sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    95
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    96
  (branch merge, don't forget to commit)
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    97
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    98
  $ hg commit -m "Merge branch 'sebhtml/99991-topic-X' into 'default'"
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
    99
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   100
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   101
Check the log of topic X, topic Y, and default branch
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   102
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   103
  $ hg log -B sebhtml/99992-topic-Y
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   104
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   105
  $ hg log -B sebhtml/99991-topic-X
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   106
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   107
  $ hg log -b default
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   108
  changeset:   4:c26ba8c1e1cb
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   109
  tag:         tip
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   110
  parent:      3:2189f3fb90d6
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   111
  parent:      1:29f39dea9bf9
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   112
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   113
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   114
  summary:     Merge branch 'sebhtml/99991-topic-X' into 'default'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   115
  
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   116
  changeset:   3:2189f3fb90d6
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   117
  parent:      0:eaea25376a59
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   118
  parent:      2:11df7969cf8d
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   119
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   120
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   121
  summary:     Merge branch 'sebhtml/99992-topic-Y' into 'default'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   122
  
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   123
  changeset:   0:eaea25376a59
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   124
  user:        test
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   125
  date:        Thu Jan 01 00:00:00 1970 +0000
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   126
  summary:     Add foo in 'default'
0aa118f18d4b log: add bookmark option to "hg log"
Sebastien Boisvert <sebhtml@protonmail.com>
parents:
diff changeset
   127