tests/test-bookmarks-current.t
author Brodie Rao <brodie@sf.io>
Mon, 16 Sep 2013 01:08:29 -0700
changeset 20192 38fad5e76ee8
parent 19147 5b1835485442
child 21024 7731a2281cf0
permissions -rw-r--r--
branches: simplify with repo.branchmap().iterbranches() Running hg branches on the PyPy repo (with 996) over a busy NFS server, before this change: $ time hg --profile branches > /dev/null CallCount Recursive Total(s) Inline(s) module:lineno(function) 1069 0 1.2955 1.2955 <open> 1063 0 0.5576 0.5576 <method 'close' of 'file' objects> 4122 0 0.1993 0.0449 mercurial.repoview:161(changelog) 8240 0 0.0771 0.0299 mercurial.changelog:133(tip) 4122 0 0.0422 0.0204 mercurial.localrepo:26(__get__) 8240 0 0.0252 0.0131 <len> 4122 0 0.0060 0.0037 mercurial.repoview:112(filterrevs) 8240 0 0.0028 0.0028 <hash> 3029 0 0.2139 0.0390 mercurial.context:202(__init__) 3029 0 0.1402 0.0339 mercurial.repoview:161(changelog) 3029 0 0.0240 0.0087 mercurial.changelog:183(rev) 9087 0 0.0067 0.0067 <isinstance> 1096 0 0.0025 0.0025 <binascii.unhexlify> 4125 0 0.0015 0.0015 <len> 4229 0 0.0344 0.0344 mercurial.revlog:296(rev) 1061 0 0.0343 0.0343 <method 'seek' of 'file' objects> 1063 0 0.0339 0.0339 <method 'read' of 'file' objects> 40476 16488 0.0479 0.0311 <len> 16488 0 0.0216 0.0168 mercurial.revlog:262(__len__) 8240 0 0.0771 0.0299 mercurial.changelog:133(tip) 8240 0 0.0281 0.0203 mercurial.changelog:190(node) 8240 0 0.0191 0.0095 <len> 1342 0 0.0278 0.0278 <zlib.decompress> 1074 0 2.2143 0.0266 mercurial.changelog:270(read) 1074 0 2.1328 0.0230 mercurial.revlog:907(revision) 1073 0 0.0208 0.0108 mercurial.changelog:28(decodeextra) 2148 0 0.0072 0.0072 <method 'split' of 'str' objects> 2148 0 0.0211 0.0038 mercurial.encoding:61(tolocal) 1074 0 0.0028 0.0028 <method 'index' of 'str' objects> 1061 0 1.9811 0.0237 mercurial.revlog:817(_loadchunk) real 0m2.742s user 0m0.811s sys 0m0.188s After this change: $ time hg --profile branches > /dev/null CallCount Recursive Total(s) Inline(s) module:lineno(function) 2092 0 0.1444 0.0292 mercurial.context:202(__init__) 2092 0 0.0908 0.0216 mercurial.repoview:161(changelog) 2092 0 0.0164 0.0057 mercurial.changelog:183(rev) 6276 0 0.0045 0.0045 <isinstance> 1096 0 0.0024 0.0024 <binascii.unhexlify> 3188 0 0.0013 0.0013 <len> 2218 0 0.0230 0.0230 mercurial.revlog:296(rev) 2111 0 0.1028 0.0218 mercurial.repoview:161(changelog) 4218 0 0.0387 0.0146 mercurial.changelog:133(tip) 2111 0 0.0238 0.0104 mercurial.localrepo:26(__get__) 4218 0 0.0122 0.0062 <len> 2111 0 0.0038 0.0021 mercurial.repoview:112(filterrevs) 4218 0 0.0014 0.0014 <hash> 20240 8444 0.0233 0.0149 <len> 8444 0 0.0110 0.0084 mercurial.revlog:262(__len__) 4218 0 0.0387 0.0146 mercurial.changelog:133(tip) 4218 0 0.0144 0.0103 mercurial.changelog:190(node) 4218 0 0.0097 0.0048 <len> 2398 1 0.0271 0.0115 mercurial.localrepo:26(__get__) 2398 1 0.0146 0.0046 mercurial.scmutil:939(__get__) 2124 0 0.0009 0.0009 mercurial.localrepo:330(unfiltered) 274 0 0.0002 0.0002 mercurial.repoview:192(unfiltered) 4 0 0.1409 0.0112 mercurial.branchmap:19(read) 1096 0 0.1113 0.0028 mercurial.localrepo:407(__contains__) 1098 0 0.0020 0.0020 <method 'split' of 'str' objects> 1097 0 0.0019 0.0019 <binascii.unhexlify> 1096 0 0.0093 0.0018 mercurial.encoding:61(tolocal) 1096 0 0.0010 0.0010 <method 'append' of 'list' objects> 4349 0 0.0150 0.0105 mercurial.changelog:190(node) 4349 0 0.0045 0.0045 mercurial.revlog:317(node) real 0m0.362s user 0m0.329s sys 0m0.024s
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     1
  $ hg init
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     2
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     3
no bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
     4
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     5
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     6
  no bookmarks set
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     7
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
     8
set bookmark X
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
     9
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    10
  $ hg bookmark X
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    11
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    12
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    13
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    14
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    15
   * X                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    16
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    17
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
    18
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    19
  $ hg --config extensions.color= --config color.mode=ansi \
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    20
  >     bookmark --color=always
12942
05fffd665170 tests: use (esc) for all non-ASCII test output
Mads Kiilerich <mads@kiilerich.com>
parents: 11862
diff changeset
    21
  \x1b[0;32m * X                         -1:000000000000\x1b[0m (esc)
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    22
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    23
update to bookmark X
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    24
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    25
  $ hg update X
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    26
  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
    27
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    28
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    29
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    30
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    31
   * X                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    32
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    33
rename
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    34
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    35
  $ hg bookmark -m X Z
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    36
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    37
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    38
13620
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    39
  $ 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
    40
  Z (no-eol)
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    41
  $ cat .hg/bookmarks
8ee4b00ddfd8 bookmarks: fix update of the current bookmark during rename
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 13469
diff changeset
    42
  0000000000000000000000000000000000000000 Z
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    43
  $ hg bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    44
   * Z                         -1:000000000000
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    45
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    46
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
    47
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    48
  $ hg bookmark Y X
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    49
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    50
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    51
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    52
  $ hg bookmark
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    53
     X                         -1:000000000000
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    54
   * Y                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    55
     Z                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    56
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    57
  $ hg bookmark -d X
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
    58
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    59
commit
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    60
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    61
  $ echo 'b' > b
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    62
  $ hg add b
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    63
  $ hg commit -m'test'
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    64
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    65
list bookmarks
7551
cab1cf26ca58 bookmarks: tests for track.current option
David Soria Parra <dsp@php.net>
parents:
diff changeset
    66
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    67
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    68
   * Y                         0:719295282060
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    69
     Z                         -1:000000000000
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    70
13433
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    71
Verify that switching to Z updates the current bookmark:
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    72
  $ hg update Z
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    73
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    74
  $ hg bookmark
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    75
     Y                         0:719295282060
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    76
   * Z                         -1:000000000000
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    77
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    78
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
    79
  $ hg update Y
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    80
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0b1bbc46516e bookmarks: verify switching bookmarks works properly
Augie Fackler <durin42@gmail.com>
parents: 13416
diff changeset
    81
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    82
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
    83
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    84
  $ hg bookmark -d Y
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    85
  $ hg bookmark -d Z
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    86
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    87
list bookmarks
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    88
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    89
  $ hg bookmark
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    90
  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
    91
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    92
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
    93
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    94
  $ hg update tip
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
    95
  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
    96
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
    97
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
    98
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
    99
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   100
  $ 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
   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
list bookmarks, Y should not be active
11862
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   103
cad06c8d2073 tests: unify test-bookmarks-current
Martin Geisler <mg@lazybytes.net>
parents: 11561
diff changeset
   104
  $ 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
   105
     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
   106
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   107
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
   108
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19110
diff changeset
   109
  $ 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
   110
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   111
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
   112
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   113
  $ 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
   114
  $ hg bookmarks
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   115
   * Y                         0:719295282060
9029b1a38c30 bookmarks: allow to create/move bookmark without making it current (issue2788)
Kevin Bullock <kbullock@ringworld.org>
parents: 13620
diff changeset
   116
     Z                         0:719295282060
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   117
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   118
deactivate current bookmark using -i
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   119
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   120
  $ hg bookmark -i Y
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   121
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   122
     Y                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   123
     Z                         0:719295282060
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 up -q Y
17735
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   126
  $ hg bookmark -i
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   127
  $ hg bookmarks
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   128
     Y                         0:719295282060
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   129
     Z                         0:719295282060
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   130
  $ hg bookmark -i
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   131
  no active bookmark
605fe310691f bookmarks: deactivate current bookmark if no name is given
Kevin Bullock <kbullock@ringworld.org>
parents: 16742
diff changeset
   132
  $ hg up -q Y
14189
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   133
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   134
   * Y                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   135
     Z                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   136
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   137
deactivate current bookmark while renaming
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   138
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   139
  $ hg bookmark -i -m Y X
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   140
  $ hg bookmarks
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   141
     X                         0:719295282060
328422b0380d bookmarks: allow deactivating current bookmark with -i
Kevin Bullock <kbullock@ringworld.org>
parents: 14188
diff changeset
   142
     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
   143
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   144
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
   145
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   146
  $ echo a > a
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   147
  $ hg ci -Am1
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   148
  adding a
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   149
  $ echo b >> a
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   150
  $ hg ci -Am2
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   151
  $ 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
   152
  $ 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
   153
  $ hg update X
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   154
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   155
  $ hg bookmarks
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   156
   * 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
   157
     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
   158
     X@2                       2:49e1c4e84c58
16742
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   159
     Z                         0:719295282060
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   160
  $ hg update
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   161
  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
   162
  updating bookmark X
973671fc0804 bookmarks: test that bare update forwards active bookmark
Kevin Bullock <kbullock@ringworld.org>
parents: 16191
diff changeset
   163
  $ hg bookmarks
19110
741d94aa92e4 bookmarks: resolve divergent bookmarks when moving active bookmark forward
Sean Farley <sean.michael.farley@gmail.com>
parents: 17735
diff changeset
   164
   * X                         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
16191
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   167
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
   168
to a revision
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   169
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   170
  $ echo a >> b
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   171
  $ hg ci -m.
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   172
  $ 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
   173
  $ 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
   174
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   175
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
   176
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
   177
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
  $ 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
   182
  $ 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
   183
  [1]
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   184
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   185
when a bookmark is active, hg up -r . is
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   186
analogus to hg book -i <active bookmark>
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   187
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   188
  $ 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
   189
  $ hg up -q .
7c75924a6926 update: delete bookmarks.current when explicitly updating to a rev (issue3276)
Idan Kamara <idankk86@gmail.com>
parents: 14189
diff changeset
   190
  $ 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
   191
  [1]