tests/test-bookmarks.t
author pacien <pacien.trangirard@pacien.net>
Thu, 22 Sep 2022 16:09:53 +0200
changeset 49499 4f36738a869a
parent 48876 42d2b31cee0b
child 49987 1e6015ddf698
permissions -rw-r--r--
tests: fix http-bad-server expected errors for python 3.10 (issue6643) The format of the error message changed with this version of Python. This also removes obsolete Python 3 checks.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
     1
31051
96eaefd350ae tests: make directory to prevent test process from going out of $TESTTMP
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30556
diff changeset
     2
  $ hg init repo
96eaefd350ae tests: make directory to prevent test process from going out of $TESTTMP
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 30556
diff changeset
     3
  $ cd repo
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
     4
34938
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
     5
  $ cat > $TESTTMP/hook.sh <<'EOF'
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
     6
  > echo "test-hook-bookmark: $HG_BOOKMARK:  $HG_OLDNODE -> $HG_NODE"
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
     7
  > EOF
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
     8
  $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh"
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
     9
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    10
no bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    11
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    12
  $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    13
  no bookmarks set
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    14
22776
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
    15
  $ hg bookmarks -Tjson
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
    16
  [
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
    17
  ]
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
    18
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    19
bookmark rev -1
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    20
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    21
  $ hg bookmark X --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    22
  test-hook-bookmark: X:   -> 0000000000000000000000000000000000000000
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    23
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    24
list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    25
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    26
  $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    27
   * X                         -1:000000000000
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    28
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    29
list bookmarks with color
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    30
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    31
  $ hg --config extensions.color= --config color.mode=ansi \
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    32
  >    bookmarks --color=always
22775
b59c2c8c45df bookmarks: split ui.write() so that it can be easily ported to formatter api
Yuya Nishihara <yuya@tcha.org>
parents: 22105
diff changeset
    33
  \x1b[0;32m * \x1b[0m\x1b[0;32mX\x1b[0m\x1b[0;32m                         -1:000000000000\x1b[0m (esc)
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    34
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    35
  $ echo a > a
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    36
  $ hg add a
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    37
  $ hg commit -m 0 --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    38
  test-hook-bookmark: X:  0000000000000000000000000000000000000000 -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac
10826
717c35d55fb3 color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents: 7261
diff changeset
    39
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    40
bookmark X moved to rev 0
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    41
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    42
  $ hg bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    43
   * X                         0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    44
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    45
look up bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    46
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    47
  $ hg log -r X
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    48
  changeset:   0:f7b1eb17ad24
13386
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
    49
  bookmark:    X
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    50
  tag:         tip
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    51
  user:        test
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    52
  date:        Thu Jan 01 00:00:00 1970 +0000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    53
  summary:     0
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    54
  
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    55
18075
2c1fc483efa4 commands: 'hg bookmark NAME' should work even with ui.strict=True
Kevin Bullock <kbullock@ringworld.org>
parents: 17882
diff changeset
    56
second bookmark for rev 0, command should work even with ui.strict on
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    57
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    58
  $ hg --config ui.strict=1 bookmark X2 --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    59
  test-hook-bookmark: X2:   -> f7b1eb17ad24730a1651fccd46c43826d1bbc2ac
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    60
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    61
bookmark rev -1 again
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    62
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    63
  $ hg bookmark -r null Y
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    64
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    65
list bookmarks
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    66
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    67
  $ hg bookmarks
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
    68
     X                         0:f7b1eb17ad24
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
    69
   * X2                        0:f7b1eb17ad24
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    70
     Y                         -1:000000000000
39753
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    71
  $ hg bookmarks -l
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    72
     X                         0:f7b1eb17ad24
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    73
   * X2                        0:f7b1eb17ad24
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    74
     Y                         -1:000000000000
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    75
  $ hg bookmarks -l X Y
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    76
     X                         0:f7b1eb17ad24
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    77
     Y                         -1:000000000000
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    78
  $ hg bookmarks -l .
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    79
   * X2                        0:f7b1eb17ad24
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    80
  $ hg bookmarks -l X A Y
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    81
  abort: bookmark 'A' does not exist
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
    82
  [10]
39753
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    83
  $ hg bookmarks -l -r0
43901
5cde16489b42 bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Martin von Zweigbergk <martinvonz@google.com>
parents: 43900
diff changeset
    84
  abort: cannot specify both --list and --rev
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
    85
  [10]
39753
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    86
  $ hg bookmarks -l --inactive
43902
e623ad1b4800 bookmarks: use check_incompatible_arguments() for inactive+action
Martin von Zweigbergk <martinvonz@google.com>
parents: 43901
diff changeset
    87
  abort: cannot specify both --inactive and --list
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
    88
  [10]
39753
b05b4b91de3d bookmarks: add explicit option to list bookmarks of the given names
Yuya Nishihara <yuya@tcha.org>
parents: 39752
diff changeset
    89
37850
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
    90
  $ hg log -T '{bookmarks % "{rev} {bookmark}\n"}'
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
    91
  0 X
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
    92
  0 X2
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
    93
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    94
  $ echo b > b
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    95
  $ hg add b
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    96
  $ hg commit -m 1 --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
    97
  test-hook-bookmark: X2:  f7b1eb17ad24730a1651fccd46c43826d1bbc2ac -> 925d80f479bb026b0fb3deb27503780b13f74123
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
    98
38538
2f7104984857 bookmarks: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 37850
diff changeset
    99
  $ hg bookmarks -T '{rev}:{node|shortest} {bookmark} {desc|firstline}\n'
2f7104984857 bookmarks: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 37850
diff changeset
   100
  0:f7b1 X 0
2f7104984857 bookmarks: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 37850
diff changeset
   101
  1:925d X2 1
2f7104984857 bookmarks: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 37850
diff changeset
   102
  -1:0000 Y 
2f7104984857 bookmarks: add support for log-like template keywords and functions
Yuya Nishihara <yuya@tcha.org>
parents: 37850
diff changeset
   103
22776
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   104
  $ hg bookmarks -Tjson
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   105
  [
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   106
   {
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   107
    "active": false,
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   108
    "bookmark": "X",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   109
    "node": "f7b1eb17ad24730a1651fccd46c43826d1bbc2ac",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   110
    "rev": 0
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   111
   },
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   112
   {
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   113
    "active": true,
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   114
    "bookmark": "X2",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   115
    "node": "925d80f479bb026b0fb3deb27503780b13f74123",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   116
    "rev": 1
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   117
   },
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   118
   {
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   119
    "active": false,
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   120
    "bookmark": "Y",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   121
    "node": "0000000000000000000000000000000000000000",
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   122
    "rev": -1
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   123
   }
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   124
  ]
564ae7d2ec9b bookmarks: port to generic templater
Yuya Nishihara <yuya@tcha.org>
parents: 22775
diff changeset
   125
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   126
bookmarks revset
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   127
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   128
  $ hg log -r 'bookmark()'
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   129
  changeset:   0:f7b1eb17ad24
13386
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
   130
  bookmark:    X
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   131
  user:        test
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   132
  date:        Thu Jan 01 00:00:00 1970 +0000
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   133
  summary:     0
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   134
  
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   135
  changeset:   1:925d80f479bb
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   136
  bookmark:    X2
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   137
  tag:         tip
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   138
  user:        test
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   139
  date:        Thu Jan 01 00:00:00 1970 +0000
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   140
  summary:     1
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   141
  
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   142
  $ hg log -r 'bookmark(Y)'
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   143
  $ hg log -r 'bookmark(X2)'
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   144
  changeset:   1:925d80f479bb
13386
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
   145
  bookmark:    X2
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   146
  tag:         tip
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   147
  user:        test
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   148
  date:        Thu Jan 01 00:00:00 1970 +0000
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   149
  summary:     1
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   150
  
16822
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   151
  $ hg log -r 'bookmark("re:X")'
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   152
  changeset:   0:f7b1eb17ad24
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   153
  bookmark:    X
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   154
  user:        test
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   155
  date:        Thu Jan 01 00:00:00 1970 +0000
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   156
  summary:     0
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   157
  
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   158
  changeset:   1:925d80f479bb
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   159
  bookmark:    X2
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   160
  tag:         tip
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   161
  user:        test
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   162
  date:        Thu Jan 01 00:00:00 1970 +0000
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   163
  summary:     1
da55d8a77390 revset: add pattern matching to 'bookmarks' revset expression
Simon King <simon@simonking.org.uk>
parents: 16573
diff changeset
   164
  
22105
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   165
  $ hg log -r 'bookmark("literal:X")'
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   166
  changeset:   0:f7b1eb17ad24
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   167
  bookmark:    X
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   168
  user:        test
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   169
  date:        Thu Jan 01 00:00:00 1970 +0000
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   170
  summary:     0
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   171
  
3efe3c2609e0 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329)
Michael O'Connor <mkoconnor@gmail.com>
parents: 22091
diff changeset
   172
39303
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   173
"." is expanded to the active bookmark:
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   174
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   175
  $ hg log -r 'bookmark(.)'
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   176
  changeset:   1:925d80f479bb
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   177
  bookmark:    X2
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   178
  tag:         tip
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   179
  user:        test
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   180
  date:        Thu Jan 01 00:00:00 1970 +0000
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   181
  summary:     1
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   182
  
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   183
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   184
but "literal:." is not since "." seems not a literal bookmark:
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   185
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   186
  $ hg log -r 'bookmark("literal:.")'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   187
  abort: bookmark '.' does not exist
48116
5ced12cfa41b errors: raise InputError on bad revset to revrange() iff provided by the user
Martin von Zweigbergk <martinvonz@google.com>
parents: 47581
diff changeset
   188
  [10]
39303
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   189
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   190
"." should fail if there's no active bookmark:
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   191
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   192
  $ hg bookmark --inactive
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   193
  $ hg log -r 'bookmark(.)'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   194
  abort: no active bookmark
48116
5ced12cfa41b errors: raise InputError on bad revset to revrange() iff provided by the user
Martin von Zweigbergk <martinvonz@google.com>
parents: 47581
diff changeset
   195
  [10]
39303
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   196
  $ hg log -r 'present(bookmark(.))'
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   197
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13911
diff changeset
   198
  $ hg log -r 'bookmark(unknown)'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   199
  abort: bookmark 'unknown' does not exist
48116
5ced12cfa41b errors: raise InputError on bad revset to revrange() iff provided by the user
Martin von Zweigbergk <martinvonz@google.com>
parents: 47581
diff changeset
   200
  [10]
26538
5c9ec1cc671a revset: strip off "literal:" prefix from bookmark not found error
Yuya Nishihara <yuya@tcha.org>
parents: 26286
diff changeset
   201
  $ hg log -r 'bookmark("literal:unknown")'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   202
  abort: bookmark 'unknown' does not exist
48116
5ced12cfa41b errors: raise InputError on bad revset to revrange() iff provided by the user
Martin von Zweigbergk <martinvonz@google.com>
parents: 47581
diff changeset
   203
  [10]
23978
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22776
diff changeset
   204
  $ hg log -r 'bookmark("re:unknown")'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22776
diff changeset
   205
  $ hg log -r 'present(bookmark("literal:unknown"))'
eeb5d5ab14a6 revset: raise RepoLookupError to make present() predicate continue the query
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22776
diff changeset
   206
  $ hg log -r 'present(bookmark("re:unknown"))'
13925
c315ffc13a25 tests: add tests for non-existant branch/tag/bookmark
Idan Kamara <idankk86@gmail.com>
parents: 13911
diff changeset
   207
12822
f13acb96b2a7 Fix and unify transplant and bookmarks revsets doc registration
Patrick Mezard <pmezard@gmail.com>
parents: 12714
diff changeset
   208
  $ hg help revsets | grep 'bookmark('
f13acb96b2a7 Fix and unify transplant and bookmarks revsets doc registration
Patrick Mezard <pmezard@gmail.com>
parents: 12714
diff changeset
   209
      "bookmark([name])"
12714
f5178fbcd197 bookmarks: add revset for referencing bookmarks
Augie Fackler <durin42@gmail.com>
parents: 12346
diff changeset
   210
39303
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   211
reactivate "X2"
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   212
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   213
  $ hg update X2
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   214
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   215
  (activating bookmark X2)
1eb370761fa0 revset: expand bookmark(.) to the active bookmark
Yuya Nishihara <yuya@tcha.org>
parents: 38538
diff changeset
   216
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   217
bookmarks X and X2 moved to rev 1, Y at rev -1
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   218
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   219
  $ hg bookmarks
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   220
     X                         0:f7b1eb17ad24
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   221
   * X2                        1:925d80f479bb
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   222
     Y                         -1:000000000000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   223
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   224
bookmark rev 0 again
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   225
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   226
  $ hg bookmark -r 0 Z
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   227
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   228
  $ hg update X
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   229
  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: 21404
diff changeset
   230
  (activating bookmark X)
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   231
  $ echo c > c
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   232
  $ hg add c
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   233
  $ hg commit -m 2
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   234
  created new head
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   235
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   236
bookmarks X moved to rev 2, Y at rev -1, Z at rev 0
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   237
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   238
  $ hg bookmarks
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   239
   * X                         2:db815d6d32e6
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   240
     X2                        1:925d80f479bb
13388
a184dbd9b2c5 localrepo: sort hg bookmark output
David Soria Parra <dsp@php.net>
parents: 13386
diff changeset
   241
     Y                         -1:000000000000
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   242
     Z                         0:f7b1eb17ad24
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   243
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   244
rename nonexistent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   245
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   246
  $ hg bookmark -m A B
13911
6bc340940c18 bookmarks: change error messages to match those given by 'hg tag' commands
Idan Kamara <idankk86@gmail.com>
parents: 13663
diff changeset
   247
  abort: bookmark 'A' does not exist
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   248
  [10]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   249
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   250
rename to existent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   251
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   252
  $ hg bookmark -m X Y
13911
6bc340940c18 bookmarks: change error messages to match those given by 'hg tag' commands
Idan Kamara <idankk86@gmail.com>
parents: 13663
diff changeset
   253
  abort: bookmark 'Y' already exists (use -f to force)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11861
diff changeset
   254
  [255]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   255
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   256
force rename to existent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   257
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   258
  $ hg bookmark -f -m X Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   259
33900
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   260
rename bookmark using .
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   261
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   262
  $ hg book rename-me
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   263
  $ hg book -m . renamed --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   264
  test-hook-bookmark: rename-me:  db815d6d32e69058eadefc8cffbad37675707975 -> 
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   265
  test-hook-bookmark: renamed:   -> db815d6d32e69058eadefc8cffbad37675707975
33900
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   266
  $ hg bookmark
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   267
     X2                        1:925d80f479bb
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   268
     Y                         2:db815d6d32e6
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   269
     Z                         0:f7b1eb17ad24
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   270
   * renamed                   2:db815d6d32e6
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   271
  $ hg up -q Y
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   272
  $ hg book -d renamed --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   273
  test-hook-bookmark: renamed:  db815d6d32e69058eadefc8cffbad37675707975 -> 
33900
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   274
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   275
rename bookmark using . with no active bookmark
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   276
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   277
  $ hg book rename-me
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   278
  $ hg book -i rename-me
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   279
  $ hg book -m . renamed
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   280
  abort: no active bookmark
48368
8c4881c07f57 errors: use detailed exit code for RepoLookupError
Martin von Zweigbergk <martinvonz@google.com>
parents: 48116
diff changeset
   281
  [10]
33900
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   282
  $ hg up -q Y
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   283
  $ hg book -d rename-me
10f1809ab98f bookmarks: allow renaming active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33213
diff changeset
   284
33913
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   285
delete bookmark using .
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   286
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   287
  $ hg book delete-me
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   288
  $ hg book -d .
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   289
  $ hg bookmark
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   290
     X2                        1:925d80f479bb
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   291
     Y                         2:db815d6d32e6
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   292
     Z                         0:f7b1eb17ad24
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   293
  $ hg up -q Y
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   294
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   295
delete bookmark using . with no active bookmark
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   296
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   297
  $ hg book delete-me
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   298
  $ hg book -i delete-me
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   299
  $ hg book -d .
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45845
diff changeset
   300
  abort: no active bookmark
48368
8c4881c07f57 errors: use detailed exit code for RepoLookupError
Martin von Zweigbergk <martinvonz@google.com>
parents: 48116
diff changeset
   301
  [10]
33913
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   302
  $ hg up -q Y
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   303
  $ hg book -d delete-me
5cd6d4826f9f bookmarks: allow deleting active bookmark using '.'
David Demelier <markand@malikania.fr>
parents: 33900
diff changeset
   304
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   305
list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   306
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   307
  $ hg bookmark
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   308
     X2                        1:925d80f479bb
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   309
   * Y                         2:db815d6d32e6
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   310
     Z                         0:f7b1eb17ad24
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   311
17686
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   312
bookmarks from a revset
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   313
  $ hg bookmark -r '.^1' REVSET
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   314
  $ hg bookmark -r ':tip' TIP
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19111
diff changeset
   315
  $ hg up -q TIP
17686
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   316
  $ hg bookmarks
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   317
     REVSET                    0:f7b1eb17ad24
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   318
   * TIP                       2:db815d6d32e6
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   319
     X2                        1:925d80f479bb
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   320
     Y                         2:db815d6d32e6
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   321
     Z                         0:f7b1eb17ad24
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   322
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   323
  $ hg bookmark -d REVSET
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   324
  $ hg bookmark -d TIP
6e4b962600a3 bookmarks: teach the -r option to use revsets
David Soria Parra <dsp@php.net>
parents: 17264
diff changeset
   325
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   326
rename without new name or multiple names
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   327
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   328
  $ hg bookmark -m Y
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   329
  abort: new bookmark name required
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   330
  [10]
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   331
  $ hg bookmark -m Y Y2 Y3
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   332
  abort: only one new bookmark name allowed
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   333
  [10]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   334
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   335
delete without name
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   336
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   337
  $ hg bookmark -d
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   338
  abort: bookmark name required
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   339
  [10]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   340
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   341
delete nonexistent bookmark
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   342
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   343
  $ hg bookmark -d A
13911
6bc340940c18 bookmarks: change error messages to match those given by 'hg tag' commands
Idan Kamara <idankk86@gmail.com>
parents: 13663
diff changeset
   344
  abort: bookmark 'A' does not exist
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   345
  [10]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   346
39752
2d478b05fb14 bookmarks: reject --delete with --inactive which makes no sense
Yuya Nishihara <yuya@tcha.org>
parents: 39480
diff changeset
   347
delete with --inactive
2d478b05fb14 bookmarks: reject --delete with --inactive which makes no sense
Yuya Nishihara <yuya@tcha.org>
parents: 39480
diff changeset
   348
2d478b05fb14 bookmarks: reject --delete with --inactive which makes no sense
Yuya Nishihara <yuya@tcha.org>
parents: 39480
diff changeset
   349
  $ hg bookmark -d --inactive Y
43902
e623ad1b4800 bookmarks: use check_incompatible_arguments() for inactive+action
Martin von Zweigbergk <martinvonz@google.com>
parents: 43901
diff changeset
   350
  abort: cannot specify both --inactive and --delete
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   351
  [10]
39752
2d478b05fb14 bookmarks: reject --delete with --inactive which makes no sense
Yuya Nishihara <yuya@tcha.org>
parents: 39480
diff changeset
   352
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   353
bookmark name with spaces should be stripped
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   354
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   355
  $ hg bookmark ' x  y '
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   356
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   357
list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   358
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   359
  $ hg bookmarks
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   360
     X2                        1:925d80f479bb
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   361
     Y                         2:db815d6d32e6
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   362
     Z                         0:f7b1eb17ad24
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   363
   * x  y                      2:db815d6d32e6
37850
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   364
  $ hg log -T '{bookmarks % "{rev} {bookmark}\n"}'
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   365
  2 Y
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   366
  2 x  y
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   367
  1 X2
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   368
  0 Z
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   369
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   370
look up stripped bookmark name
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   371
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   372
  $ hg log -r '"x  y"'
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   373
  changeset:   2:db815d6d32e6
13386
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
   374
  bookmark:    Y
f78bc5ddbe4f templater: add bookmarks to templates and default output
David Soria Parra <dsp@php.net>
parents: 13385
diff changeset
   375
  bookmark:    x  y
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   376
  tag:         tip
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   377
  parent:      0:f7b1eb17ad24
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   378
  user:        test
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   379
  date:        Thu Jan 01 00:00:00 1970 +0000
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   380
  summary:     2
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   381
  
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   382
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   383
reject bookmark name with newline
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   384
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   385
  $ hg bookmark '
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   386
  > '
17814
f88ca484c3e9 bookmarks: remove redundant check for newline
Kevin Bullock <kbullock@ringworld.org>
parents: 17790
diff changeset
   387
  abort: bookmark names cannot consist entirely of whitespace
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   388
  [10]
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   389
17789
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   390
  $ hg bookmark -m Z '
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   391
  > '
17814
f88ca484c3e9 bookmarks: remove redundant check for newline
Kevin Bullock <kbullock@ringworld.org>
parents: 17790
diff changeset
   392
  abort: bookmark names cannot consist entirely of whitespace
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   393
  [10]
17789
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   394
17816
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   395
bookmark with reserved name
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   396
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   397
  $ hg bookmark tip
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   398
  abort: the name 'tip' is reserved
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   399
  [10]
17816
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   400
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   401
  $ hg bookmark .
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   402
  abort: the name '.' is reserved
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   403
  [10]
17816
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   404
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   405
  $ hg bookmark null
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   406
  abort: the name 'null' is reserved
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   407
  [10]
17816
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   408
19388ba75a06 bookmarks: disallow bookmarks named 'tip', '.', or 'null'
Kevin Bullock <kbullock@ringworld.org>
parents: 17814
diff changeset
   409
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   410
bookmark with existing name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   411
18773
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   412
  $ hg bookmark X2
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   413
  abort: bookmark 'X2' already exists (use -f to force)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11861
diff changeset
   414
  [255]
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   415
17789
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   416
  $ hg bookmark -m Y Z
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   417
  abort: bookmark 'Z' already exists (use -f to force)
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   418
  [255]
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   419
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   420
bookmark with name of branch
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   421
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   422
  $ hg bookmark default
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   423
  abort: a bookmark cannot have the name of an existing branch
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   424
  [255]
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   425
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   426
  $ hg bookmark -m Y default
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   427
  abort: a bookmark cannot have the name of an existing branch
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   428
  [255]
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   429
18566
341868ef0cf6 bookmark: don't allow integers as bookmark/branch/tag names
Durham Goode <durham@fb.com>
parents: 18471
diff changeset
   430
bookmark with integer name
341868ef0cf6 bookmark: don't allow integers as bookmark/branch/tag names
Durham Goode <durham@fb.com>
parents: 18471
diff changeset
   431
341868ef0cf6 bookmark: don't allow integers as bookmark/branch/tag names
Durham Goode <durham@fb.com>
parents: 18471
diff changeset
   432
  $ hg bookmark 10
19070
290a61833b99 translations: change label integer error to not specify the kind of label
Durham Goode <durham@fb.com>
parents: 18782
diff changeset
   433
  abort: cannot use an integer as a name
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   434
  [10]
18566
341868ef0cf6 bookmark: don't allow integers as bookmark/branch/tag names
Durham Goode <durham@fb.com>
parents: 18471
diff changeset
   435
32451
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   436
bookmark with a name that matches a node id
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   437
  $ hg bookmark 925d80f479bb db815d6d32e6 --config "$TESTHOOK"
32451
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   438
  bookmark 925d80f479bb matches a changeset hash
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   439
  (did you leave a -r out of an 'hg bookmark' command?)
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   440
  bookmark db815d6d32e6 matches a changeset hash
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   441
  (did you leave a -r out of an 'hg bookmark' command?)
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   442
  test-hook-bookmark: 925d80f479bb:   -> db815d6d32e69058eadefc8cffbad37675707975
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   443
  test-hook-bookmark: db815d6d32e6:   -> db815d6d32e69058eadefc8cffbad37675707975
32451
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   444
  $ hg bookmark -d 925d80f479bb
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   445
  $ hg bookmark -d db815d6d32e6
bce5ebe72859 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
Augie Fackler <augie@google.com>
parents: 31767
diff changeset
   446
32482
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   447
  $ cd ..
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   448
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   449
bookmark with a name that matches an ambiguous node id
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   450
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   451
  $ hg init ambiguous
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   452
  $ cd ambiguous
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   453
  $ echo 0 > a
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   454
  $ hg ci -qAm 0
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   455
  $ for i in 1057 2857 4025; do
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   456
  >   hg up -q 0
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   457
  >   echo $i > a
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   458
  >   hg ci -qm $i
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   459
  > done
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   460
  $ hg up -q null
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   461
  $ hg log -r0: -T '{rev}:{node}\n'
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   462
  0:b4e73ffab476aa0ee32ed81ca51e07169844bc6a
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   463
  1:c56256a09cd28e5764f32e8e2810d0f01e2e357a
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   464
  2:c5623987d205cd6d9d8389bfc40fff9dbb670b48
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   465
  3:c562ddd9c94164376c20b86b0b4991636a3bf84f
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   466
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   467
  $ hg bookmark -r0 c562
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   468
  $ hg bookmarks
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   469
     c562                      0:b4e73ffab476
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   470
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   471
  $ cd ..
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   472
17790
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   473
incompatible options
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   474
32482
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   475
  $ cd repo
579df5aaa425 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
Yuya Nishihara <yuya@tcha.org>
parents: 32451
diff changeset
   476
17790
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   477
  $ hg bookmark -m Y -d Z
43900
3b50de911200 bookmarks: use cmdutil.check_at_most_one_arg() for action
Martin von Zweigbergk <martinvonz@google.com>
parents: 43601
diff changeset
   478
  abort: cannot specify both --delete and --rename
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   479
  [10]
17790
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   480
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   481
  $ hg bookmark -r 1 -d Z
43901
5cde16489b42 bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Martin von Zweigbergk <martinvonz@google.com>
parents: 43900
diff changeset
   482
  abort: cannot specify both --delete and --rev
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   483
  [10]
17790
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   484
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   485
  $ hg bookmark -r 1 -m Z Y
43901
5cde16489b42 bookmarks: use cmdutil.check_incompatible_arguments() for action+rev
Martin von Zweigbergk <martinvonz@google.com>
parents: 43900
diff changeset
   486
  abort: cannot specify both --rename and --rev
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   487
  [10]
17790
0291e122fb05 bookmarks: abort when incompatible options are used (issue3663)
David Soria Parra <dsp@php.net>
parents: 17789
diff changeset
   488
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   489
force bookmark with existing name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   490
34708
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   491
  $ hg bookmark -f X2 --config "$TESTHOOK"
ee5f0d047b41 bookmark: add a dedicated txnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   492
  test-hook-bookmark: X2:  925d80f479bb026b0fb3deb27503780b13f74123 -> db815d6d32e69058eadefc8cffbad37675707975
18782
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   493
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   494
force bookmark back to where it was, should deactivate it
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   495
18773
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   496
  $ hg bookmark -fr1 X2
18782
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   497
  $ hg bookmarks
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   498
     X2                        1:925d80f479bb
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   499
     Y                         2:db815d6d32e6
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   500
     Z                         0:f7b1eb17ad24
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   501
     x  y                      2:db815d6d32e6
18773
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   502
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   503
forward bookmark to descendant without --force
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   504
56dd55da2f7d bookmarks: allow moving a bookmark forward to a descendant
Kevin Bullock <kbullock@ringworld.org>
parents: 18623
diff changeset
   505
  $ hg bookmark Z
18774
b616c9b8001d bookmarks: fix test broken by 0bba1ff2ac7b
Kevin Bullock <kbullock@ringworld.org>
parents: 18773
diff changeset
   506
  moving bookmark 'Z' forward from f7b1eb17ad24
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   507
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   508
list bookmarks
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   509
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   510
  $ hg bookmark
13448
97b69883e929 bookmarks: mark new bookmark as current if it points to the current dirstate
David Soria Parra <dsp@php.net>
parents: 13425
diff changeset
   511
     X2                        1:925d80f479bb
13416
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   512
     Y                         2:db815d6d32e6
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   513
   * Z                         2:db815d6d32e6
5431b3f3e52e bookmarks: make track.current=True default behaviour and remove option (BC)
David Soria Parra <dsp@php.net>
parents: 13388
diff changeset
   514
     x  y                      2:db815d6d32e6
37850
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   515
  $ hg log -T '{bookmarks % "{rev} {bookmark}\n"}'
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   516
  2 Y
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   517
  2 Z
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   518
  2 x  y
04ceb267271a bookmarks: cache reverse mapping (issue5868)
Yuya Nishihara <yuya@tcha.org>
parents: 36570
diff changeset
   519
  1 X2
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   520
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   521
revision but no bookmark name
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   522
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   523
  $ hg bookmark -r .
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   524
  abort: bookmark name required
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   525
  [10]
7261
4ba89b6d0e05 bookmarks: Add tests
Joel Rosdahl <joel@rosdahl.net>
parents:
diff changeset
   526
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   527
bookmark name with whitespace only
11704
18c47562d331 bookmarks: don't allow name to contain whitespaces only
Idan Kamara <idankk86@gmail.com>
parents: 11282
diff changeset
   528
11861
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   529
  $ hg bookmark ' '
41d481ddd976 tests: unify test-bookmarks
Martin Geisler <mg@lazybytes.net>
parents: 11704
diff changeset
   530
  abort: bookmark names cannot consist entirely of whitespace
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   531
  [10]
13425
0fe36c347c00 bookmarks: forbid \0 \r \n : in bookmark names (BC)
David Soria Parra <dsp@php.net>
parents: 13416
diff changeset
   532
17789
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   533
  $ hg bookmark -m Y ' '
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   534
  abort: bookmark names cannot consist entirely of whitespace
45913
9acbe30953e8 errors: raise InputError on bad bookmark argument
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   535
  [10]
17789
4cfd02c2df9a bookmarks: check bookmark format during rename (issue3662)
David Soria Parra <dsp@php.net>
parents: 17704
diff changeset
   536
13425
0fe36c347c00 bookmarks: forbid \0 \r \n : in bookmark names (BC)
David Soria Parra <dsp@php.net>
parents: 13416
diff changeset
   537
invalid bookmark
0fe36c347c00 bookmarks: forbid \0 \r \n : in bookmark names (BC)
David Soria Parra <dsp@php.net>
parents: 13416
diff changeset
   538
0fe36c347c00 bookmarks: forbid \0 \r \n : in bookmark names (BC)
David Soria Parra <dsp@php.net>
parents: 13416
diff changeset
   539
  $ hg bookmark 'foo:bar'
17850
71c1513fd560 scmutil: generalize message to make it more i18n-friendly
Wagner Bruna <wbruna@yahoo.com>
parents: 17821
diff changeset
   540
  abort: ':' cannot be used in a name
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   541
  [10]
17821
361ab1e2086f scmutil: add bad character checking to checknewlabel
Kevin Bullock <kbullock@ringworld.org>
parents: 17816
diff changeset
   542
361ab1e2086f scmutil: add bad character checking to checknewlabel
Kevin Bullock <kbullock@ringworld.org>
parents: 17816
diff changeset
   543
  $ hg bookmark 'foo
361ab1e2086f scmutil: add bad character checking to checknewlabel
Kevin Bullock <kbullock@ringworld.org>
parents: 17816
diff changeset
   544
  > bar'
17850
71c1513fd560 scmutil: generalize message to make it more i18n-friendly
Wagner Bruna <wbruna@yahoo.com>
parents: 17821
diff changeset
   545
  abort: '\n' cannot be used in a name
45845
f96fa4de5055 errors: use InputError for errors about bad label names (tags etc)
Martin von Zweigbergk <martinvonz@google.com>
parents: 45827
diff changeset
   546
  [10]
13425
0fe36c347c00 bookmarks: forbid \0 \r \n : in bookmark names (BC)
David Soria Parra <dsp@php.net>
parents: 13416
diff changeset
   547
13474
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   548
the bookmark extension should be ignored now that it is part of core
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   549
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   550
  $ echo "[extensions]" >> $HGRCPATH
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   551
  $ echo "bookmarks=" >> $HGRCPATH
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   552
  $ hg bookmarks
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   553
     X2                        1:925d80f479bb
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   554
     Y                         2:db815d6d32e6
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   555
   * Z                         2:db815d6d32e6
6c2e476b7a11 tests: check if the bookmarks extension is ignored
David Soria Parra <dsp@php.net>
parents: 13469
diff changeset
   556
     x  y                      2:db815d6d32e6
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   557
13454
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   558
test summary
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   559
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   560
  $ hg summary
14906
7c3c8f37e84f summary: show bookmarks separate from tags and note active mark (issue2892)
Augie Fackler <durin42@gmail.com>
parents: 14846
diff changeset
   561
  parent: 2:db815d6d32e6 tip
13454
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   562
   2
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   563
  branch: default
14906
7c3c8f37e84f summary: show bookmarks separate from tags and note active mark (issue2892)
Augie Fackler <durin42@gmail.com>
parents: 14846
diff changeset
   564
  bookmarks: *Z Y x  y
13454
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   565
  commit: (clean)
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   566
  update: 1 new changesets, 2 branch heads (merge)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25349
diff changeset
   567
  phases: 3 draft
13454
afc84a879ac8 summary: add bookmarks to summary
David Soria Parra <dsp@php.net>
parents: 13448
diff changeset
   568
13477
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13474
diff changeset
   569
test id
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13474
diff changeset
   570
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13474
diff changeset
   571
  $ hg id
0fb2ff949790 id: add bookmarks to id
Kevin Bullock <kbullock@ringworld.org>
parents: 13474
diff changeset
   572
  db815d6d32e6 tip Y/Z/x  y
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   573
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   574
test rollback
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   575
14268
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   576
  $ echo foo > f1
25744
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   577
  $ hg bookmark tmp-rollback
14268
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   578
  $ hg ci -Amr
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   579
  adding f1
25744
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   580
  $ hg bookmarks
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   581
     X2                        1:925d80f479bb
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   582
     Y                         2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   583
     Z                         2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   584
   * tmp-rollback              3:2bf5cfec5864
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   585
     x  y                      2:db815d6d32e6
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   586
  $ hg rollback
14268
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   587
  repository tip rolled back to revision 2 (undo commit)
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   588
  working directory now based on revision 2
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   589
  $ hg bookmarks
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   590
     X2                        1:925d80f479bb
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   591
     Y                         2:db815d6d32e6
18782
22f87dc77604 bookmarks: moving the active bookmark deactivates it
Kevin Bullock <kbullock@ringworld.org>
parents: 18781
diff changeset
   592
     Z                         2:db815d6d32e6
25744
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   593
   * tmp-rollback              2:db815d6d32e6
14268
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   594
     x  y                      2:db815d6d32e6
25744
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   595
  $ hg bookmark -f Z -r 1
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   596
  $ hg rollback
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   597
  repository tip rolled back to revision 2 (undo bookmark)
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   598
  $ hg bookmarks
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   599
     X2                        1:925d80f479bb
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   600
     Y                         2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   601
     Z                         2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   602
   * tmp-rollback              2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   603
     x  y                      2:db815d6d32e6
e78a80f8f51e bookmarks: change bookmark within a transaction
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25382
diff changeset
   604
  $ hg bookmark -d tmp-rollback
14268
a55a0045704c merge with stable
Matt Mackall <mpm@selenic.com>
parents: 13925 14266
diff changeset
   605
18781
99b78269a2ec bookmarks: allow (re-)activating a bookmark on the current changeset
Kevin Bullock <kbullock@ringworld.org>
parents: 18774
diff changeset
   606
activate bookmark on working dir parent without --force
99b78269a2ec bookmarks: allow (re-)activating a bookmark on the current changeset
Kevin Bullock <kbullock@ringworld.org>
parents: 18774
diff changeset
   607
99b78269a2ec bookmarks: allow (re-)activating a bookmark on the current changeset
Kevin Bullock <kbullock@ringworld.org>
parents: 18774
diff changeset
   608
  $ hg bookmark --inactive Z
99b78269a2ec bookmarks: allow (re-)activating a bookmark on the current changeset
Kevin Bullock <kbullock@ringworld.org>
parents: 18774
diff changeset
   609
  $ hg bookmark Z
99b78269a2ec bookmarks: allow (re-)activating a bookmark on the current changeset
Kevin Bullock <kbullock@ringworld.org>
parents: 18774
diff changeset
   610
43598
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   611
deactivate current 'Z', but also add 'Y'
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   612
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   613
  $ hg bookmark -d Y
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   614
  $ hg bookmark --inactive Z Y
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   615
  $ hg bookmark -l
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   616
     X2                        1:925d80f479bb
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   617
     Y                         2:db815d6d32e6
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   618
     Z                         2:db815d6d32e6
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   619
     x  y                      2:db815d6d32e6
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   620
  $ hg bookmark Z
2a8cd7edf409 bookmarks: fix handling of multiple bookmarks with one to be deactivated
Yuya Nishihara <yuya@tcha.org>
parents: 42897
diff changeset
   621
43601
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   622
bookmark wdir to activate it (issue6218)
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   623
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   624
  $ hg bookmark -d Z
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   625
  $ hg bookmark -r 'wdir()' Z
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   626
  $ hg bookmark -l
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   627
     X2                        1:925d80f479bb
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   628
     Y                         2:db815d6d32e6
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   629
   * Z                         2:db815d6d32e6
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   630
     x  y                      2:db815d6d32e6
a80d5ddecc2d bookmarks: accept explicit -r 'wdir()' when adding new bookmarks (issue6218)
Yuya Nishihara <yuya@tcha.org>
parents: 43598
diff changeset
   631
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   632
test clone
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   633
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   634
  $ hg bookmark -r 2 -i @
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   635
  $ hg bookmark -r 2 -i a@
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   636
  $ hg bookmarks
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   637
     @                         2:db815d6d32e6
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   638
     X2                        1:925d80f479bb
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   639
     Y                         2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   640
   * Z                         2:db815d6d32e6
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   641
     a@                        2:db815d6d32e6
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   642
     x  y                      2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   643
  $ hg clone . cloned-bookmarks
17882
36ed69d4593d clone: show status "updating to bookmark @"
Adrian Buehlmann <adrian@cadifra.com>
parents: 17872
diff changeset
   644
  updating to bookmark @
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   645
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   646
  $ hg -R cloned-bookmarks bookmarks
17870
7d2dd10ce9ea clone: activate @ bookmark if updating to it
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17868
diff changeset
   647
   * @                         2:db815d6d32e6
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   648
     X2                        1:925d80f479bb
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   649
     Y                         2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   650
     Z                         2:db815d6d32e6
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   651
     a@                        2:db815d6d32e6
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   652
     x  y                      2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   653
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   654
test clone with pull protocol
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   655
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   656
  $ hg clone --pull . cloned-bookmarks-pull
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   657
  requesting all changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   658
  adding changesets
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   659
  adding manifests
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   660
  adding file changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   661
  added 3 changesets with 3 changes to 3 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
   662
  new changesets f7b1eb17ad24:db815d6d32e6
17882
36ed69d4593d clone: show status "updating to bookmark @"
Adrian Buehlmann <adrian@cadifra.com>
parents: 17872
diff changeset
   663
  updating to bookmark @
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   664
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   665
  $ hg -R cloned-bookmarks-pull bookmarks
17870
7d2dd10ce9ea clone: activate @ bookmark if updating to it
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17868
diff changeset
   666
   * @                         2:db815d6d32e6
14266
89e7d35e0ef0 fix bookmarks rollback behavior
Alexander Solovyov <alexander@solovyov.net>
parents: 13477
diff changeset
   667
     X2                        1:925d80f479bb
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   668
     Y                         2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   669
     Z                         2:db815d6d32e6
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   670
     a@                        2:db815d6d32e6
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   671
     x  y                      2:db815d6d32e6
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   672
19147
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   673
delete multiple bookmarks at once
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   674
5b1835485442 bookmarks: allow bookmark command to take multiple arguments
Kevin Bullock <kbullock@ringworld.org>
parents: 19112
diff changeset
   675
  $ hg bookmark -d @ a@
16276
6b16ded5c810 bookmarks: clone non-divergent bookmarks with @ in them
Kevin Bullock <kbullock@ringworld.org>
parents: 15615
diff changeset
   676
17868
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   677
test clone with a bookmark named "default" (issue3677)
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   678
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   679
  $ hg bookmark -r 1 -f -i default
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   680
  $ hg clone . cloned-bookmark-default
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   681
  updating to branch default
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   682
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   683
  $ hg -R cloned-bookmark-default bookmarks
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   684
     X2                        1:925d80f479bb
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   685
     Y                         2:db815d6d32e6
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   686
     Z                         2:db815d6d32e6
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   687
     default                   1:925d80f479bb
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   688
     x  y                      2:db815d6d32e6
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   689
  $ hg -R cloned-bookmark-default parents -q
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   690
  2:db815d6d32e6
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   691
  $ hg bookmark -d default
04755508f8ed test-bookmarks.t: check that bookmark "default" is not automatically checked out
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17850
diff changeset
   692
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   693
test clone with a specific revision
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   694
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   695
  $ hg clone -r 925d80 . cloned-bookmarks-rev
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   696
  adding changesets
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   697
  adding manifests
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   698
  adding file changes
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   699
  added 2 changesets with 2 changes to 2 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
   700
  new changesets f7b1eb17ad24:925d80f479bb
13604
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   701
  updating to branch default
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   702
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   703
  $ hg -R cloned-bookmarks-rev bookmarks
3f6a4579f803 hg: add support for cloning bookmarks
David Soria Parra <dsp@php.net>
parents: 13477
diff changeset
   704
     X2                        1:925d80f479bb
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   705
17703
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   706
test clone with update to a bookmark
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   707
25893
04ae6feb04c5 test-bookmarks.t: avoid nested repo
Siddharth Agarwal <sid0@fb.com>
parents: 25789
diff changeset
   708
  $ hg clone -u Z . ../cloned-bookmarks-update
17703
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   709
  updating to branch default
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   710
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
25893
04ae6feb04c5 test-bookmarks.t: avoid nested repo
Siddharth Agarwal <sid0@fb.com>
parents: 25789
diff changeset
   711
  $ hg -R ../cloned-bookmarks-update bookmarks
17703
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   712
     X2                        1:925d80f479bb
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   713
     Y                         2:db815d6d32e6
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   714
   * Z                         2:db815d6d32e6
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   715
     x  y                      2:db815d6d32e6
4a07d2ff7c66 clone: activate bookmark specified with --updaterev
Thomas Arendsen Hein <thomas@intevation.de>
parents: 17264
diff changeset
   716
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   717
create bundle with two heads
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   718
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   719
  $ hg clone . tobundle
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   720
  updating to branch default
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   721
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   722
  $ echo x > tobundle/x
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   723
  $ hg -R tobundle add tobundle/x
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   724
  $ hg -R tobundle commit -m'x'
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   725
  $ hg -R tobundle update -r -2
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   726
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   727
  $ echo y > tobundle/y
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   728
  $ hg -R tobundle branch test
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   729
  marked working directory as branch test
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 14906
diff changeset
   730
  (branches are permanent and global, did you want a bookmark?)
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   731
  $ hg -R tobundle add tobundle/y
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   732
  $ hg -R tobundle commit -m'y'
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   733
  $ hg -R tobundle bundle tobundle.hg
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   734
  searching for changes
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   735
  2 changesets found
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   736
  $ hg unbundle tobundle.hg
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   737
  adding changesets
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   738
  adding manifests
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   739
  adding file changes
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   740
  added 2 changesets with 2 changes to 2 files (+1 heads)
39480
89630d0b3e23 phase: report number of non-public changeset alongside the new range
Boris Feld <boris.feld@octobus.net>
parents: 39304
diff changeset
   741
  new changesets 125c9a1d6df6:9ba5f110a0b3 (2 drafts)
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   742
  (run 'hg heads' to see heads, 'hg merge' to merge)
18471
2096e025a728 update: update to current bookmark if it moved out from under us (issue3682)
Kevin Bullock <kbullock@ringworld.org>
parents: 18075
diff changeset
   743
25349
62da2d7745f9 commands: rename current to active in variables and comments
Ryan McElroy <rmcelroy@fb.com>
parents: 25111
diff changeset
   744
update to active bookmark if it's not the parent
18471
2096e025a728 update: update to current bookmark if it moved out from under us (issue3682)
Kevin Bullock <kbullock@ringworld.org>
parents: 18075
diff changeset
   745
33213
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   746
(it is known issue that fsmonitor can't handle nested repositories. In
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   747
this test scenario, cloned-bookmark-default and tobundle exist in the
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   748
working directory of current repository)
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   749
18620
7da487b0256a summary: test that current bookmark isn't shown
Kevin Bullock <kbullock@ringworld.org>
parents: 18566
diff changeset
   750
  $ hg summary
7da487b0256a summary: test that current bookmark isn't shown
Kevin Bullock <kbullock@ringworld.org>
parents: 18566
diff changeset
   751
  parent: 2:db815d6d32e6 
7da487b0256a summary: test that current bookmark isn't shown
Kevin Bullock <kbullock@ringworld.org>
parents: 18566
diff changeset
   752
   2
7da487b0256a summary: test that current bookmark isn't shown
Kevin Bullock <kbullock@ringworld.org>
parents: 18566
diff changeset
   753
  branch: default
22091
f72b71ba756b unbundle: don't advance bookmarks (issue4322) (BC)
Matt Mackall <mpm@selenic.com>
parents: 21503
diff changeset
   754
  bookmarks: *Z Y x  y
33213
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   755
  commit: 1 added, 1 unknown (new branch head) (no-fsmonitor !)
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   756
  commit: 1 added, * unknown (new branch head) (glob) (fsmonitor !)
18620
7da487b0256a summary: test that current bookmark isn't shown
Kevin Bullock <kbullock@ringworld.org>
parents: 18566
diff changeset
   757
  update: 2 new changesets (update)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25349
diff changeset
   758
  phases: 5 draft
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   759
  $ hg update
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   760
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
22091
f72b71ba756b unbundle: don't advance bookmarks (issue4322) (BC)
Matt Mackall <mpm@selenic.com>
parents: 21503
diff changeset
   761
  updating bookmark Z
13663
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   762
  $ hg bookmarks
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   763
     X2                        1:925d80f479bb
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   764
     Y                         2:db815d6d32e6
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   765
   * Z                         3:125c9a1d6df6
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   766
     x  y                      2:db815d6d32e6
d16c99f16f00 bundle: update current bookmark to most recent revision on current branch
David Soria Parra <dsp@php.net>
parents: 13604
diff changeset
   767
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   768
pull --update works the same as pull && update
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   769
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   770
  $ hg bookmark -r3 Y
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   771
  moving bookmark 'Y' forward from db815d6d32e6
30556
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 30332
diff changeset
   772
  $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update
c059286a0f9c tests: replace "cp -r" with "cp -R"
Jun Wu <quark@fb.com>
parents: 30332
diff changeset
   773
  $ cp -R ../cloned-bookmarks-update ../cloned-bookmarks-manual-update-with-divergence
26285
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   774
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   775
(manual version)
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   776
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   777
  $ hg -R ../cloned-bookmarks-manual-update update Y
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   778
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   779
  (activating bookmark Y)
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   780
  $ hg -R ../cloned-bookmarks-manual-update pull .
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   781
  pulling from .
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   782
  searching for changes
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   783
  adding changesets
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   784
  adding manifests
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   785
  adding file changes
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   786
  updating bookmark Y
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   787
  updating bookmark Z
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40534
diff changeset
   788
  added 2 changesets with 2 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
   789
  new changesets 125c9a1d6df6:9ba5f110a0b3
26285
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   790
  (run 'hg heads' to see heads, 'hg merge' to merge)
26286
4b685712fa45 bookmark: do not crash when active bookmark is forward and --date is used
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26285
diff changeset
   791
4b685712fa45 bookmark: do not crash when active bookmark is forward and --date is used
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26285
diff changeset
   792
(# tests strange but with --date crashing when bookmark have to move)
4b685712fa45 bookmark: do not crash when active bookmark is forward and --date is used
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26285
diff changeset
   793
4b685712fa45 bookmark: do not crash when active bookmark is forward and --date is used
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26285
diff changeset
   794
  $ hg -R ../cloned-bookmarks-manual-update update -d 1986
4b685712fa45 bookmark: do not crash when active bookmark is forward and --date is used
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26285
diff changeset
   795
  abort: revision matching date not found
45827
8d72e29ad1e0 errors: introduce InputError and use it from commands and cmdutil
Martin von Zweigbergk <martinvonz@google.com>
parents: 43902
diff changeset
   796
  [10]
26285
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   797
  $ hg -R ../cloned-bookmarks-manual-update update
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   798
  updating to active bookmark Y
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   799
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   800
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   801
(all in one version)
91cad8eb7951 bookmark: actually test update behavior in both cases
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 25893
diff changeset
   802
25893
04ae6feb04c5 test-bookmarks.t: avoid nested repo
Siddharth Agarwal <sid0@fb.com>
parents: 25789
diff changeset
   803
  $ hg -R ../cloned-bookmarks-update update Y
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   804
  0 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: 21404
diff changeset
   805
  (activating bookmark Y)
25893
04ae6feb04c5 test-bookmarks.t: avoid nested repo
Siddharth Agarwal <sid0@fb.com>
parents: 25789
diff changeset
   806
  $ hg -R ../cloned-bookmarks-update pull --update .
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   807
  pulling from .
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   808
  searching for changes
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   809
  adding changesets
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   810
  adding manifests
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   811
  adding file changes
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   812
  updating bookmark Y
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   813
  updating bookmark Z
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40534
diff changeset
   814
  added 2 changesets with 2 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
   815
  new changesets 125c9a1d6df6:9ba5f110a0b3
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   816
  updating to active bookmark Y
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   817
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   818
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   819
We warn about divergent during bare update to the active bookmark
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   820
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   821
  $ hg -R ../cloned-bookmarks-manual-update-with-divergence update Y
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   822
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   823
  (activating bookmark Y)
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   824
  $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks -r X2 Y@1
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   825
  $ hg -R ../cloned-bookmarks-manual-update-with-divergence bookmarks
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   826
     X2                        1:925d80f479bb
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   827
   * Y                         2:db815d6d32e6
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   828
     Y@1                       1:925d80f479bb
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   829
     Z                         2:db815d6d32e6
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   830
     x  y                      2:db815d6d32e6
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   831
  $ hg -R ../cloned-bookmarks-manual-update-with-divergence pull
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34938
diff changeset
   832
  pulling from $TESTTMP/repo
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   833
  searching for changes
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   834
  adding changesets
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   835
  adding manifests
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   836
  adding file changes
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   837
  updating bookmark Y
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   838
  updating bookmark Z
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40534
diff changeset
   839
  added 2 changesets with 2 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
   840
  new changesets 125c9a1d6df6:9ba5f110a0b3
28029
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   841
  (run 'hg heads' to see heads, 'hg merge' to merge)
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   842
  $ hg -R ../cloned-bookmarks-manual-update-with-divergence update
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   843
  updating to active bookmark Y
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   844
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   845
  1 other divergent bookmarks for "Y"
72072cfc7e91 update: warn about other topological heads on bare update
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 27948
diff changeset
   846
14845
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   847
test wrongly formated bookmark
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   848
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   849
  $ echo '' >> .hg/bookmarks
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   850
  $ hg bookmarks
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   851
     X2                        1:925d80f479bb
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   852
     Y                         3:125c9a1d6df6
14845
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   853
   * Z                         3:125c9a1d6df6
677339529a53 bookmarks: more robust parsing of bookmarks file
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14268
diff changeset
   854
     x  y                      2:db815d6d32e6
14846
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   855
  $ echo "Ican'thasformatedlines" >> .hg/bookmarks
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   856
  $ hg bookmarks
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   857
  malformed line in .hg/bookmarks: "Ican'thasformatedlines"
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   858
     X2                        1:925d80f479bb
19523
f37b5a17e6a0 bookmarks: pull --update updates to active bookmark if it moved (issue4007)
Kevin Bullock <kbullock@ringworld.org>
parents: 19147
diff changeset
   859
     Y                         3:125c9a1d6df6
14846
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   860
   * Z                         3:125c9a1d6df6
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   861
     x  y                      2:db815d6d32e6
5097d8b5078c bookmarks: add a warning for non empty malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14845
diff changeset
   862
16573
5983de86462c bookmarks: catch the proper exception for missing revisions
Matt Mackall <mpm@selenic.com>
parents: 16276
diff changeset
   863
test missing revisions
5983de86462c bookmarks: catch the proper exception for missing revisions
Matt Mackall <mpm@selenic.com>
parents: 16276
diff changeset
   864
32735
d7522f983f37 bookmarks: explicitly convert to 'node' during initialization
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 32482
diff changeset
   865
  $ echo "925d80f479b925d80f479bc925d80f479bccabab z" > .hg/bookmarks
16573
5983de86462c bookmarks: catch the proper exception for missing revisions
Matt Mackall <mpm@selenic.com>
parents: 16276
diff changeset
   866
  $ hg book
5983de86462c bookmarks: catch the proper exception for missing revisions
Matt Mackall <mpm@selenic.com>
parents: 16276
diff changeset
   867
  no bookmarks set
17264
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   868
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   869
test stripping a non-checked-out but bookmarked revision
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   870
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 19523
diff changeset
   871
  $ hg log --graph
17264
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   872
  o  changeset:   4:9ba5f110a0b3
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   873
  |  branch:      test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   874
  |  tag:         tip
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   875
  |  parent:      2:db815d6d32e6
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   876
  |  user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   877
  |  date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   878
  |  summary:     y
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   879
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   880
  | @  changeset:   3:125c9a1d6df6
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   881
  |/   user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   882
  |    date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   883
  |    summary:     x
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   884
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   885
  o  changeset:   2:db815d6d32e6
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   886
  |  parent:      0:f7b1eb17ad24
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   887
  |  user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   888
  |  date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   889
  |  summary:     2
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   890
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   891
  | o  changeset:   1:925d80f479bb
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   892
  |/   user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   893
  |    date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   894
  |    summary:     1
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   895
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   896
  o  changeset:   0:f7b1eb17ad24
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   897
     user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   898
     date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   899
     summary:     0
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   900
  
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   901
  $ hg book should-end-on-two
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   902
  $ hg co --clean 4
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   903
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
21404
ca275f7ec576 update: when deactivating a bookmark, print a message
Siddharth Agarwal <sid0@fb.com>
parents: 20117
diff changeset
   904
  (leaving bookmark should-end-on-two)
17264
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   905
  $ hg book four
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   906
  $ hg --config extensions.mq= strip 3
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   907
  saved backup bundle to * (glob)
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   908
should-end-on-two should end up pointing to revision 2, as that's the
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   909
tipmost surviving ancestor of the stripped revision.
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 19523
diff changeset
   910
  $ hg log --graph
17264
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   911
  @  changeset:   3:9ba5f110a0b3
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   912
  |  branch:      test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   913
  |  bookmark:    four
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   914
  |  tag:         tip
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   915
  |  user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   916
  |  date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   917
  |  summary:     y
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   918
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   919
  o  changeset:   2:db815d6d32e6
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   920
  |  bookmark:    should-end-on-two
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   921
  |  parent:      0:f7b1eb17ad24
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   922
  |  user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   923
  |  date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   924
  |  summary:     2
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   925
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   926
  | o  changeset:   1:925d80f479bb
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   927
  |/   user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   928
  |    date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   929
  |    summary:     1
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   930
  |
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   931
  o  changeset:   0:f7b1eb17ad24
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   932
     user:        test
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   933
     date:        Thu Jan 01 00:00:00 1970 +0000
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   934
     summary:     0
ec7b9bec19c9 strip: move bookmarks to nearest ancestor rather than '.'
Augie Fackler <raf@durin42.com>
parents: 16822
diff changeset
   935
  
19109
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   936
30332
318a24b52eeb spelling: fixes of non-dictionary words
Mads Kiilerich <madski@unity3d.com>
parents: 28830
diff changeset
   937
no-op update doesn't deactivate bookmarks
26676
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   938
33213
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   939
(it is known issue that fsmonitor can't handle nested repositories. In
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   940
this test scenario, cloned-bookmark-default and tobundle exist in the
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   941
working directory of current repository)
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   942
28500
2e1bceeea520 update: omit redundant activating message for already active bookmark
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   943
  $ hg bookmarks
2e1bceeea520 update: omit redundant activating message for already active bookmark
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   944
   * four                      3:9ba5f110a0b3
2e1bceeea520 update: omit redundant activating message for already active bookmark
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28065
diff changeset
   945
     should-end-on-two         2:db815d6d32e6
28065
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   946
  $ hg up four
6b1fc09c699a update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 28029
diff changeset
   947
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26676
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   948
  $ hg up
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   949
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   950
  $ hg sum
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   951
  parent: 3:9ba5f110a0b3 tip
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   952
   y
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   953
  branch: test
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   954
  bookmarks: *four
33213
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   955
  commit: 2 unknown (clean) (no-fsmonitor !)
0bec70c1df15 tests: make output lines conditional for testing with fsmonitor
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32735
diff changeset
   956
  commit: * unknown (clean) (glob) (fsmonitor !)
26676
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   957
  update: (current)
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   958
  phases: 4 draft
71a485130beb bookmarks: don't deactivate on no-op update (issue4901)
Matt Mackall <mpm@selenic.com>
parents: 26538
diff changeset
   959
19109
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   960
test clearing divergent bookmarks of linear ancestors
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   961
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   962
  $ hg bookmark Z -r 0
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   963
  $ hg bookmark Z@1 -r 1
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   964
  $ hg bookmark Z@2 -r 2
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   965
  $ hg bookmark Z@3 -r 3
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   966
  $ hg book
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   967
     Z                         0:f7b1eb17ad24
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   968
     Z@1                       1:925d80f479bb
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   969
     Z@2                       2:db815d6d32e6
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19111
diff changeset
   970
     Z@3                       3:9ba5f110a0b3
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19111
diff changeset
   971
   * four                      3:9ba5f110a0b3
19109
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   972
     should-end-on-two         2:db815d6d32e6
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   973
  $ hg bookmark Z
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   974
  moving bookmark 'Z' forward from f7b1eb17ad24
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   975
  $ hg book
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   976
   * Z                         3:9ba5f110a0b3
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   977
     Z@1                       1:925d80f479bb
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   978
     four                      3:9ba5f110a0b3
26c51e87e807 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
Sean Farley <sean.michael.farley@gmail.com>
parents: 19070
diff changeset
   979
     should-end-on-two         2:db815d6d32e6
19111
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   980
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   981
test clearing only a single divergent bookmark across branches
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   982
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   983
  $ hg book foo -r 1
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   984
  $ hg book foo@1 -r 0
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   985
  $ hg book foo@2 -r 2
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   986
  $ hg book foo@3 -r 3
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   987
  $ hg book foo -r foo@3
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   988
  $ hg book
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19111
diff changeset
   989
   * Z                         3:9ba5f110a0b3
19111
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   990
     Z@1                       1:925d80f479bb
19112
23f785b38af3 bookmarks: fix bug that activated a bookmark even with -r passed
Sean Farley <sean.michael.farley@gmail.com>
parents: 19111
diff changeset
   991
     foo                       3:9ba5f110a0b3
19111
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   992
     foo@1                     0:f7b1eb17ad24
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   993
     foo@2                     2:db815d6d32e6
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   994
     four                      3:9ba5f110a0b3
6439d78e14fb bookmarks: resolve divergent bookmark when moving across a branch
Sean Farley <sean.michael.farley@gmail.com>
parents: 19109
diff changeset
   995
     should-end-on-two         2:db815d6d32e6
27948
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
   996
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
   997
pull --update works the same as pull && update (case #2)
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
   998
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
   999
It is assumed that "hg pull" itself doesn't update current active
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1000
bookmark ('Y' in tests below).
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1001
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1002
  $ hg pull -q ../cloned-bookmarks-update
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1003
  divergent bookmark Z stored as Z@2
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1004
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1005
(pulling revision on another named branch with --update updates
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1006
neither the working directory nor current active bookmark: "no-op"
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1007
case)
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1008
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1009
  $ echo yy >> y
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1010
  $ hg commit -m yy
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1011
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1012
  $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1013
   * Y                         3:125c9a1d6df6
47581
28a914b3d4ce test-bookmark: clarify the path involved in a pull creating divergence
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46417
diff changeset
  1014
  $ hg -R ../cloned-bookmarks-update path
28a914b3d4ce test-bookmark: clarify the path involved in a pull creating divergence
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46417
diff changeset
  1015
  default = $TESTTMP/repo
28a914b3d4ce test-bookmark: clarify the path involved in a pull creating divergence
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46417
diff changeset
  1016
  $ pwd
28a914b3d4ce test-bookmark: clarify the path involved in a pull creating divergence
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46417
diff changeset
  1017
  $TESTTMP/repo
27948
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1018
  $ hg -R ../cloned-bookmarks-update pull . --update
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1019
  pulling from .
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1020
  searching for changes
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1021
  adding changesets
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1022
  adding manifests
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1023
  adding file changes
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1024
  divergent bookmark Z stored as Z@default
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1025
  adding remote bookmark foo
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1026
  adding remote bookmark four
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1027
  adding remote bookmark should-end-on-two
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40534
diff changeset
  1028
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
  1029
  new changesets 5fb12f0f2d51
27948
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1030
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1031
  $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1032
  3:125c9a1d6df6
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1033
  $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1034
   * Y                         3:125c9a1d6df6
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1035
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1036
(pulling revision on current named/topological branch with --update
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1037
updates the working directory and current active bookmark)
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1038
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1039
  $ hg update -C -q 125c9a1d6df6
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1040
  $ echo xx >> x
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1041
  $ hg commit -m xx
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1042
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1043
  $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1044
   * Y                         3:125c9a1d6df6
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1045
  $ hg -R ../cloned-bookmarks-update pull . --update
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1046
  pulling from .
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1047
  searching for changes
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1048
  adding changesets
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1049
  adding manifests
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1050
  adding file changes
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40534
diff changeset
  1051
  divergent bookmark Z stored as Z@default
27948
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1052
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33946
diff changeset
  1053
  new changesets 81dcce76aa0b
27948
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1054
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1055
  updating bookmark Y
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1056
  $ hg -R ../cloned-bookmarks-update parents -T "{rev}:{node|short}\n"
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1057
  6:81dcce76aa0b
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1058
  $ hg -R ../cloned-bookmarks-update bookmarks | grep ' Y '
7cb7264cfd52 commands: advance current active bookmark at pull --update correctly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 26676
diff changeset
  1059
   * Y                         6:81dcce76aa0b
28830
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1060
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1061
  $ cd ..
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1062
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1063
ensure changelog is written before bookmarks
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1064
  $ hg init orderrepo
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1065
  $ cd orderrepo
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1066
  $ touch a
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1067
  $ hg commit -Aqm one
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1068
  $ hg book mybook
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1069
  $ echo a > a
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1070
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1071
  $ cat > $TESTTMP/pausefinalize.py <<EOF
33946
83313639b8a4 tests: update test-bookmarks to pass the import checker
Augie Fackler <raf@durin42.com>
parents: 33913
diff changeset
  1072
  > import os
83313639b8a4 tests: update test-bookmarks to pass the import checker
Augie Fackler <raf@durin42.com>
parents: 33913
diff changeset
  1073
  > import time
28830
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1074
  > from mercurial import extensions, localrepo
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1075
  > def transaction(orig, self, desc, report=None):
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1076
  >    tr = orig(self, desc, report)
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1077
  >    def sleep(*args, **kwargs):
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1078
  >        retry = 20
36570
4df06d2f60e1 tests: port test-bookmarks.t extension to Python 3
Augie Fackler <augie@google.com>
parents: 35393
diff changeset
  1079
  >        while retry > 0 and not os.path.exists(b"$TESTTMP/unpause"):
28830
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1080
  >            retry -= 1
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1081
  >            time.sleep(0.5)
36570
4df06d2f60e1 tests: port test-bookmarks.t extension to Python 3
Augie Fackler <augie@google.com>
parents: 35393
diff changeset
  1082
  >        if os.path.exists(b"$TESTTMP/unpause"):
4df06d2f60e1 tests: port test-bookmarks.t extension to Python 3
Augie Fackler <augie@google.com>
parents: 35393
diff changeset
  1083
  >            os.remove(b"$TESTTMP/unpause")
28830
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1084
  >    # It is important that this finalizer start with 'a', so it runs before
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1085
  >    # the changelog finalizer appends to the changelog.
36570
4df06d2f60e1 tests: port test-bookmarks.t extension to Python 3
Augie Fackler <augie@google.com>
parents: 35393
diff changeset
  1086
  >    tr.addfinalize(b'a-sleep', sleep)
28830
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1087
  >    return tr
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1088
  > 
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1089
  > def extsetup(ui):
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1090
  >    # This extension inserts an artifical pause during the transaction
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1091
  >    # finalizer, so we can run commands mid-transaction-close.
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1092
  >    extensions.wrapfunction(localrepo.localrepository, 'transaction',
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1093
  >                            transaction)
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1094
  > EOF
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1095
  $ hg commit -qm two --config extensions.pausefinalize=$TESTTMP/pausefinalize.py &
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1096
  $ sleep 2
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1097
  $ hg log -r .
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1098
  changeset:   0:867bc5792c8c
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1099
  bookmark:    mybook
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1100
  tag:         tip
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1101
  user:        test
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1102
  date:        Thu Jan 01 00:00:00 1970 +0000
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1103
  summary:     one
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1104
  
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1105
  $ hg bookmarks
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1106
   * mybook                    0:867bc5792c8c
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1107
  $ touch $TESTTMP/unpause
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1108
a5009789960c transaction: allow running file generators after finalizers
Durham Goode <durham@fb.com>
parents: 28500
diff changeset
  1109
  $ cd ..
31052
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1110
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1111
check whether HG_PENDING makes pending changes only in related
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1112
repositories visible to an external hook.
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1113
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1114
(emulate a transaction running concurrently by copied
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1115
.hg/bookmarks.pending in subsequent test)
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1116
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1117
  $ cat > $TESTTMP/savepending.sh <<EOF
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1118
  > cp .hg/bookmarks.pending .hg/bookmarks.pending.saved
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1119
  > exit 1 # to avoid adding new bookmark for subsequent tests
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1120
  > EOF
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1121
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1122
  $ hg init unrelated
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1123
  $ cd unrelated
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1124
  $ echo a > a
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1125
  $ hg add a
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1126
  $ hg commit -m '#0'
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1127
  $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" bookmarks INVISIBLE
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1128
  transaction abort!
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1129
  rollback completed
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1130
  abort: pretxnclose hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45913
diff changeset
  1131
  [40]
31052
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1132
  $ cp .hg/bookmarks.pending.saved .hg/bookmarks.pending
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1133
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1134
(check visible bookmarks while transaction running in repo)
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1135
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1136
  $ cat > $TESTTMP/checkpending.sh <<EOF
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1137
  > echo "@repo"
31767
6c800688afe1 tests: quote paths in shell script hooks
Matt Harbison <matt_harbison@yahoo.com>
parents: 31052
diff changeset
  1138
  > hg -R "$TESTTMP/repo" bookmarks
31052
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1139
  > echo "@unrelated"
31767
6c800688afe1 tests: quote paths in shell script hooks
Matt Harbison <matt_harbison@yahoo.com>
parents: 31052
diff changeset
  1140
  > hg -R "$TESTTMP/unrelated" bookmarks
31052
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1141
  > exit 1 # to avoid adding new bookmark for subsequent tests
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1142
  > EOF
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1143
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1144
  $ cd ../repo
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1145
  $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" bookmarks NEW
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1146
  @repo
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1147
   * NEW                       6:81dcce76aa0b
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1148
     X2                        1:925d80f479bb
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1149
     Y                         4:125c9a1d6df6
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1150
     Z                         5:5fb12f0f2d51
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1151
     Z@1                       1:925d80f479bb
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1152
     Z@2                       4:125c9a1d6df6
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1153
     foo                       3:9ba5f110a0b3
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1154
     foo@1                     0:f7b1eb17ad24
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1155
     foo@2                     2:db815d6d32e6
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1156
     four                      3:9ba5f110a0b3
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1157
     should-end-on-two         2:db815d6d32e6
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1158
     x  y                      2:db815d6d32e6
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1159
  @unrelated
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1160
  no bookmarks set
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1161
  transaction abort!
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1162
  rollback completed
0332b8fafd05 bookmarks: check HG_PENDING strictly
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 31051
diff changeset
  1163
  abort: pretxnclose hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45913
diff changeset
  1164
  [40]
34709
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1165
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1166
Check pretxnclose-bookmark can abort a transaction
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1167
--------------------------------------------------
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1168
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1169
add hooks:
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1170
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1171
* to prevent NEW bookmark on a non-public changeset
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1172
* to prevent non-forward move of NEW bookmark
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1173
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1174
  $ cat << EOF >> .hg/hgrc
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1175
  > [hooks]
34938
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
  1176
  > pretxnclose-bookmark.force-public  = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"\$HG_NODE\" -T '{phase}' | grep public > /dev/null)"
aa05b95949fe tests: adjust hooks for Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 34709
diff changeset
  1177
  > pretxnclose-bookmark.force-forward = sh -c "(echo \$HG_BOOKMARK| grep -v NEW > /dev/null) || [ -z \"\$HG_NODE\" ] || (hg log -r \"max(\$HG_OLDNODE::\$HG_NODE)\" -T 'MATCH' | grep MATCH > /dev/null)"
34709
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1178
  > EOF
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1179
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1180
  $ hg log -G -T phases
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1181
  @  changeset:   6:81dcce76aa0b
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1182
  |  tag:         tip
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1183
  |  phase:       draft
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1184
  |  parent:      4:125c9a1d6df6
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1185
  |  user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1186
  |  date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1187
  |  summary:     xx
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1188
  |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1189
  | o  changeset:   5:5fb12f0f2d51
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1190
  | |  branch:      test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1191
  | |  bookmark:    Z
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1192
  | |  phase:       draft
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1193
  | |  parent:      3:9ba5f110a0b3
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1194
  | |  user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1195
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1196
  | |  summary:     yy
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1197
  | |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1198
  o |  changeset:   4:125c9a1d6df6
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1199
  | |  bookmark:    Y
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1200
  | |  bookmark:    Z@2
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1201
  | |  phase:       public
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1202
  | |  parent:      2:db815d6d32e6
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1203
  | |  user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1204
  | |  date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1205
  | |  summary:     x
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1206
  | |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1207
  | o  changeset:   3:9ba5f110a0b3
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1208
  |/   branch:      test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1209
  |    bookmark:    foo
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1210
  |    bookmark:    four
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1211
  |    phase:       public
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1212
  |    user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1213
  |    date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1214
  |    summary:     y
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1215
  |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1216
  o  changeset:   2:db815d6d32e6
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1217
  |  bookmark:    foo@2
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1218
  |  bookmark:    should-end-on-two
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1219
  |  bookmark:    x  y
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1220
  |  phase:       public
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1221
  |  parent:      0:f7b1eb17ad24
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1222
  |  user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1223
  |  date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1224
  |  summary:     2
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1225
  |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1226
  | o  changeset:   1:925d80f479bb
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1227
  |/   bookmark:    X2
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1228
  |    bookmark:    Z@1
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1229
  |    phase:       public
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1230
  |    user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1231
  |    date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1232
  |    summary:     1
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1233
  |
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1234
  o  changeset:   0:f7b1eb17ad24
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1235
     bookmark:    foo@1
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1236
     phase:       public
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1237
     user:        test
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1238
     date:        Thu Jan 01 00:00:00 1970 +0000
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1239
     summary:     0
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1240
  
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1241
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1242
attempt to create on a default changeset
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1243
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1244
  $ hg bookmark -r 81dcce76aa0b NEW
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1245
  transaction abort!
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1246
  rollback completed
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1247
  abort: pretxnclose-bookmark.force-public hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45913
diff changeset
  1248
  [40]
34709
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1249
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1250
create on a public changeset
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1251
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1252
  $ hg bookmark -r 9ba5f110a0b3 NEW
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1253
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1254
move to the other branch
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1255
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1256
  $ hg bookmark -f -r 125c9a1d6df6 NEW
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1257
  transaction abort!
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1258
  rollback completed
c212947273a7 bookmark: add a dedicated pretxnclose-bookmark hook
Boris Feld <boris.feld@octobus.net>
parents: 34708
diff changeset
  1259
  abort: pretxnclose-bookmark.force-forward hook exited with status 1
46417
768056549737 errors: use exit code 40 for when a hook fails
Martin von Zweigbergk <martinvonz@google.com>
parents: 45913
diff changeset
  1260
  [40]