tests/test-bookmarks-current.t
author Georges Racinet <georges.racinet@octobus.net>
Fri, 27 Oct 2023 22:11:05 +0200
changeset 51239 7eea2e4109ae
parent 49621 55c6ebd11cb9
permissions -rw-r--r--
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set Since there is no Rust implementation for REVLOGV2/CHANGELOGv2, we declare them to be incompatible with Rust, hence indexes in these formats will use the implementations from Python `mercurial.ancestor`. If this is an unacceptable performance hit for current users of these formats, we can later on add Rust implementations based on the C index for them or implement these formats for the Rust indexes. Among the challenges that we had to meet, we wanted to avoid taking the GIL each time the inner (vcsgraph) iterator has to call the parents function. This would probably still be acceptable in terms of performance with `AncestorsIterator`, but not with `LazyAncestors` nor for the upcoming change in `MissingAncestors`. Hence we enclose the reference to the index in a `PySharedRef`, leading to more rigourous checking of mutations, which does pass now that there no logically immutable methods of `hg::index::Index` that take a mutable reference as input.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 48368
diff changeset
     1
  $ hg init repo
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 48368
diff changeset
     2
  $ cd repo
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     3
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     4
no bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
     5
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     6
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     7
  no bookmarks set
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     8
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     9
set bookmark X
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    10
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    11
  $ hg bookmark X
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    12
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    13
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    14
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    15
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    16
   * X                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    17
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    18
list bookmarks with color
7816
f420eafe59cd bookmarks: Set current bookmark if we create a new one on the tip
David Soria Parra <dsp@php.net>
parents: 7551
diff changeset
    19
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    20
  $ hg --config extensions.color= --config color.mode=ansi \
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    21
  >     bookmark --color=always
22775
b59c2c8c45df bookmarks: split ui.write() so that it can be easily ported to formatter api
Yuya Nishihara <yuya@tcha.org>
parents: 21503
diff changeset
    22
  \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m                         -1:000000000000\x1b[0m (esc)
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    23
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    24
update to bookmark X
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    25
28500
2e1bceeea520 update: omit redundant activating message for already active bookmark
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28385
diff changeset
    26
  $ hg bookmarks
2e1bceeea520 update: omit redundant activating message for already active bookmark
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28385
diff changeset
    27
   * X                         -1:000000000000
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    28
  $ hg update X
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    29
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
10826
717c35d55fb3 color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents: 7817
diff changeset
    30
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    31
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    32
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    33
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    34
   * X                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    35
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    36
rename
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    37
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    38
  $ hg bookmark -m X Z
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    39
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    40
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    41
13620
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    42
  $ cat .hg/bookmarks.current
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    43
  Z (no-eol)
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    44
  $ cat .hg/bookmarks
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    45
  0000000000000000000000000000000000000000 Z
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    46
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    47
   * Z                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    48
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    49
new bookmarks X and Y, first one made active
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    50
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    51
  $ hg bookmark Y X
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    52
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    53
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    54
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    55
  $ hg bookmark
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    56
     X                         -1:000000000000
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    57
   * Y                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    58
     Z                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    59
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    60
  $ hg bookmark -d X
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    61
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    62
commit
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    63
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    64
  $ echo 'b' > b
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    65
  $ hg add b
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    66
  $ hg commit -m'test'
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    67
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    68
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    69
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    70
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    71
   * Y                         0:719295282060
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    72
     Z                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    73
25349
62da2d7745f9 commands: rename current to active in variables and comments
Ryan McElroy <rmcelroy@fb.com>
parents: 22775
diff changeset
    74
Verify that switching to Z updates the active bookmark:
13433
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    75
  $ hg update Z
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    76
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
21503
10f15e34d86c update: show message when a bookmark is activated by update
Stephen Lee <sphen.lee@gmail.com>
parents: 21024
diff changeset
    77
  (activating bookmark Z)
13433
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    78
  $ hg bookmark
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    79
     Y                         0:719295282060
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    80
   * Z                         -1:000000000000
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    81
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    82
Switch back to Y for the remaining tests in this file:
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    83
  $ hg update Y
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    84
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
21503
10f15e34d86c update: show message when a bookmark is activated by update
Stephen Lee <sphen.lee@gmail.com>
parents: 21024
diff changeset
    85
  (activating bookmark Y)
13433
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    86
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    87
delete bookmarks
7817
cb516e788238 bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
Alex Unden <alu@zpuppet.org>
parents: 7816
diff changeset
    88
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    89
  $ hg bookmark -d Y
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    90
  $ hg bookmark -d Z
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    91
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    92
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    93
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    94
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    95
  no bookmarks set
7817
cb516e788238 bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
Alex Unden <alu@zpuppet.org>
parents: 7816
diff changeset
    96
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    97
update to tip
7817
cb516e788238 bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
Alex Unden <alu@zpuppet.org>
parents: 7816
diff changeset
    98
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    99
  $ hg update tip
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   100
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   101
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   102
set bookmark Y using -r . but make sure that the active
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   103
bookmark is not activated
7817
cb516e788238 bookmarks: fixes bug where a deleted bookmark may still be treated as current when track.current option is set
Alex Unden <alu@zpuppet.org>
parents: 7816
diff changeset
   104
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   105
  $ hg bookmark -r . Y
11561
e5aaaef91a27 bookmarks: ensure current bookmark is updated when specified with -r .
Brodie Rao <brodie@bitheap.org>
parents: 11141
diff changeset
   106
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   107
list bookmarks, Y should not be active
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   108
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   109
  $ hg bookmark
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   110
     Y                         0:719295282060
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   111
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   112
now, activate Y
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   113
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   114
  $ hg up -q Y
14188
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   115
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   116
set bookmark Z using -i
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   117
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   118
  $ hg bookmark -r . -i Z
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   119
  $ hg bookmarks
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   120
   * Y                         0:719295282060
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   121
     Z                         0:719295282060
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   122
25349
62da2d7745f9 commands: rename current to active in variables and comments
Ryan McElroy <rmcelroy@fb.com>
parents: 22775
diff changeset
   123
deactivate active bookmark using -i
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   124
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   125
  $ hg bookmark -i Y
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   126
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   127
     Y                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   128
     Z                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   129
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   130
  $ hg up -q Y
17735
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   131
  $ hg bookmark -i
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   132
  $ hg bookmarks
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   133
     Y                         0:719295282060
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   134
     Z                         0:719295282060
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   135
  $ hg bookmark -i
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   136
  no active bookmark
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   137
  $ hg up -q Y
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   138
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   139
   * Y                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   140
     Z                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   141
25349
62da2d7745f9 commands: rename current to active in variables and comments
Ryan McElroy <rmcelroy@fb.com>
parents: 22775
diff changeset
   142
deactivate active bookmark while renaming
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   143
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   144
  $ hg bookmark -i -m Y X
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   145
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   146
     X                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   147
     Z                         0:719295282060
16191
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   148
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   149
bare update moves the active bookmark forward and clear the divergent bookmarks
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   150
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   151
  $ echo a > a
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   152
  $ hg ci -Am1
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   153
  adding a
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   154
  $ echo b >> a
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   155
  $ hg ci -Am2
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   156
  $ hg bookmark X@1 -r 1
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   157
  $ hg bookmark X@2 -r 2
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   158
  $ hg update X
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   159
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
21503
10f15e34d86c update: show message when a bookmark is activated by update
Stephen Lee <sphen.lee@gmail.com>
parents: 21024
diff changeset
   160
  (activating bookmark X)
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   161
  $ hg bookmarks
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   162
   * X                         0:719295282060
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   163
     X@1                       1:cc586d725fbe
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   164
     X@2                       2:49e1c4e84c58
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   165
     Z                         0:719295282060
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   166
  $ hg update
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   167
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   168
  updating bookmark X
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   169
  $ hg bookmarks
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   170
   * X                         2:49e1c4e84c58
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   171
     Z                         0:719295282060
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   172
16191
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   173
test deleting .hg/bookmarks.current when explicitly updating
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   174
to a revision
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   175
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   176
  $ echo a >> b
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   177
  $ hg ci -m.
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   178
  $ hg up -q X
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   179
  $ test -f .hg/bookmarks.current
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   180
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   181
try to update to it again to make sure we don't
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   182
set and then unset it
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   183
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   184
  $ hg up -q X
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   185
  $ test -f .hg/bookmarks.current
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   186
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   187
  $ hg up -q 1
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   188
  $ test -f .hg/bookmarks.current
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   189
  [1]
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   190
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   191
when a bookmark is active, hg up -r . is
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 19147
diff changeset
   192
analogous to hg book -i <active bookmark>
16191
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   193
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   194
  $ hg up -q X
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   195
  $ hg up -q .
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   196
  $ test -f .hg/bookmarks.current
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   197
  [1]
25387
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   198
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   199
issue 4552 -- simulate a pull moving the active bookmark
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   200
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   201
  $ hg up -q X
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   202
  $ printf "Z" > .hg/bookmarks.current
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   203
  $ hg log -T '{activebookmark}\n' -r Z
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   204
  Z
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   205
  $ hg log -T '{bookmarks % "{active}\n"}' -r Z
390a10b7843b templatekw: display active bookmark more consistently (issue4552) (BC)
Ryan McElroy <rmcelroy@fb.com>
parents: 25349
diff changeset
   206
  Z
28385
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   207
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   208
test that updating to closed branch head also advances active bookmark
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   209
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   210
  $ hg commit --close-branch -m "closed"
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   211
  $ hg update -q ".^1"
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   212
  $ hg bookmark Y
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   213
  $ hg bookmarks
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   214
     X                         3:4d6bd4bfb1ae
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   215
   * Y                         3:4d6bd4bfb1ae
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   216
     Z                         0:719295282060
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   217
  $ hg update
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   218
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   219
  updating bookmark Y
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   220
  $ hg bookmarks
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   221
     X                         3:4d6bd4bfb1ae
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   222
   * Y                         4:8fa964221e8e
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   223
     Z                         0:719295282060
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   224
  $ hg parents -q
3f9e25a42e69 destutil: choose non-closed branch head at first (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 25387
diff changeset
   225
  4:8fa964221e8e
39276
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   226
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   227
Checks command to retrieve active bookmark
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   228
------------------------------------------
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   229
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   230
display how "{activebookmark}" template is unsuitable for the task
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   231
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   232
  $ hg book -T '- {activebookmark}\n'
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   233
  - 
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   234
  - Y
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   235
  - 
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   236
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   237
  $ hg book -r . W
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   238
  $ hg book -T '- {activebookmark}\n'
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   239
  - Y
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   240
  - 
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   241
  - Y
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   242
  - 
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   243
39754
c48738923dba bookmarks: remove --active in favor of --list
Yuya Nishihara <yuya@tcha.org>
parents: 39276
diff changeset
   244
  $ hg bookmarks -ql .
39276
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   245
  Y
337443f09fc8 bookmark: add an --active flag to display the active bookmark
Boris Feld <boris.feld@octobus.net>
parents: 28500
diff changeset
   246
  $ hg bookmarks --inactive
39754
c48738923dba bookmarks: remove --active in favor of --list
Yuya Nishihara <yuya@tcha.org>
parents: 39276
diff changeset
   247
  $ hg bookmarks -ql .
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 39754
diff changeset
   248
  abort: no active bookmark
48368
8c4881c07f57 errors: use detailed exit code for RepoLookupError
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   249
  [10]