tests/test-directaccess.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 02 Oct 2019 17:53:47 -0400
changeset 43257 675c776fbcd1
parent 37964 ea63a2004d09
child 45921 95c4cca641f6
permissions -rw-r--r--
sidedatacopies: directly fetch copies information from sidedata When using the sidedata mode, we don't need a complicated and expensive `context` object. Instead we directly fetch copies information from the sidedata (through a changelogrevision object). More optimisations coming. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3) base: ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3) before: ! wall 4.681985 comb 4.680000 user 4.640000 sys 0.040000 (median of 3) after: ! wall 3.955894 comb 3.950000 user 3.940000 sys 0.010000 (median of 3) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781) base: ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3) before: ! wall 6.459592 comb 6.470000 user 6.390000 sys 0.080000 (median of 3) after: ! wall 5.505774 comb 5.500000 user 5.410000 sys 0.090000 (median of 3) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4) base: ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8) before: ! wall 0.961048 comb 0.960000 user 0.940000 sys 0.020000 (median of 11) after: ! wall 0.882950 comb 0.880000 user 0.880000 sys 0.000000 (median of 11) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6 base: ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128) before: ! wall 0.021649 comb 0.020000 user 0.020000 sys 0.000000 (median of 135) after: ! wall 0.020951 comb 0.020000 user 0.020000 sys 0.000000 (median of 141) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7) base: ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392) before: ! wall 0.004022 comb 0.000000 user 0.000000 sys 0.000000 (median of 735) after: ! wall 0.003988 comb 0.000000 user 0.000000 sys 0.000000 (median of 736) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250) base: ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180) before: ! wall 0.000118 comb 0.000000 user 0.000000 sys 0.000000 (median of 19170) after: ! wall 0.000097 comb 0.000000 user 0.000000 sys 0.000000 (median of 27276) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4) base: ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10) before: ! wall 0.679500 comb 0.680000 user 0.680000 sys 0.000000 (median of 15) after: ! wall 0.596779 comb 0.600000 user 0.600000 sys 0.000000 (median of 17) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10 base: ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45) before: ! wall 0.149675 comb 0.150000 user 0.150000 sys 0.000000 (median of 66) after: ! wall 0.130786 comb 0.130000 user 0.130000 sys 0.000000 (median of 75) Differential Revision: https://phab.mercurial-scm.org/D7072
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Tests for access level on hidden commits by various commands on based of their
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
type.
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
Setting the required config to start this
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  $ cat >> $HGRCPATH <<EOF
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > [experimental]
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > evolution=createmarkers, allowunstable
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > directaccess=True
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > directaccess.revnums=True
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
  > [extensions]
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  > amend =
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  > EOF
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  $ hg init repo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ cd repo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  $ for ch in a b c; do touch $ch; echo "foo" >> $ch; hg ci -Aqm "Added "$ch; done
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  @  2:28ad74487de9599d00d81085be739c61fc340652 Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  |
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  o  1:29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added b
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  |
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  o  0:18d04c59bb5d2d4090ad9a5b59bd6274adb63add Added a
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
  $ echo "bar" >> c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  $ hg amend
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
  @  3:2443a0e664694756d8b435d06b6ad84f941b6fc0 Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
  |
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  | x  2:28ad74487de9599d00d81085be739c61fc340652 Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  |/
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  o  1:29becc82797a4bc11ec8880b58eaecd2ab3e7760 Added b
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  |
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  o  0:18d04c59bb5d2d4090ad9a5b59bd6274adb63add Added a
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    37
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
Testing read only commands on the hidden revision
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
Testing with rev number
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  $ hg exp 2 --config experimental.directaccess.revnums=False
35571
265cd9e19d26 visibility: improve the message when accessing filtered obsolete rev
Boris Feld <boris.feld@octobus.net>
parents: 35539
diff changeset
    43
  abort: hidden revision '2' was rewritten as: 2443a0e66469!
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  (use --hidden to access hidden revisions)
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  [255]
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    47
  $ hg exp 2
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  # HG changeset patch
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
  # User test
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
  # Date 0 0
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
  #      Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  # Node ID 28ad74487de9599d00d81085be739c61fc340652
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  # Parent  29becc82797a4bc11ec8880b58eaecd2ab3e7760
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
  diff -r 29becc82797a -r 28ad74487de9 c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  @@ -0,0 +1,1 @@
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
  +foo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
  $ hg log -r 2
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
  changeset:   2:28ad74487de9
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
  user:        test
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  date:        Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  obsolete:    rewritten using amend as 3:2443a0e66469
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  summary:     Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
  $ hg identify -r 2
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  28ad74487de9
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  $ hg status --change 2
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
  A c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
  $ hg status --change 2 --config experimental.directaccess.revnums=False
35571
265cd9e19d26 visibility: improve the message when accessing filtered obsolete rev
Boris Feld <boris.feld@octobus.net>
parents: 35539
diff changeset
    76
  abort: hidden revision '2' was rewritten as: 2443a0e66469!
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
  (use --hidden to access hidden revisions)
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
  [255]
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
  $ hg diff -c 2
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
  diff -r 29becc82797a -r 28ad74487de9 c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
  @@ -0,0 +1,1 @@
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    85
  +foo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    86
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
Testing with hash
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
`hg export`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  $ hg exp 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  # HG changeset patch
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
  # User test
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  # Date 0 0
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
  #      Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
  # Node ID 28ad74487de9599d00d81085be739c61fc340652
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
  # Parent  29becc82797a4bc11ec8880b58eaecd2ab3e7760
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
  Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
  diff -r 29becc82797a -r 28ad74487de9 c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
  @@ -0,0 +1,1 @@
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
  +foo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
`hg log`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  $ hg log -r 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  changeset:   2:28ad74487de9
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  user:        test
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  date:        Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  obsolete:    rewritten using amend as 3:2443a0e66469
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
  summary:     Added c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
  
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
`hg cat`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
  $ hg cat -r 28ad74 c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
  foo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
`hg diff`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
  $ hg diff -c 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
  diff -r 29becc82797a -r 28ad74487de9 c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  @@ -0,0 +1,1 @@
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
  +foo
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
`hg files`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  $ hg files -r 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  a
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
  b
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
  c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
`hg identify`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  $ hg identify -r 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  28ad74487de9
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
35538
b6ce3568771d annotate: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35523
diff changeset
   141
`hg annotate`
b6ce3568771d annotate: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35523
diff changeset
   142
b6ce3568771d annotate: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35523
diff changeset
   143
  $ hg annotate -r 28ad74 a
b6ce3568771d annotate: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35523
diff changeset
   144
  0: foo
b6ce3568771d annotate: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35523
diff changeset
   145
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
`hg status`
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
  $ hg status --change 28ad74
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
  A c
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
35539
ffd7b7cd309b archive: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35538
diff changeset
   151
`hg archive`
ffd7b7cd309b archive: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35538
diff changeset
   152
ffd7b7cd309b archive: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35538
diff changeset
   153
This should not throw error
ffd7b7cd309b archive: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35538
diff changeset
   154
  $ hg archive -r 28ad74 foo
ffd7b7cd309b archive: add support to specify hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35538
diff changeset
   155
35522
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   156
`hg update`
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   157
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   158
  $ hg up 28ad74
37964
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37716
diff changeset
   159
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37716
diff changeset
   160
  updated to hidden changeset 28ad74487de9
35711
35a0f6f31eef update: display the obsfate of hidden revision we update to
Boris Feld <boris.feld@octobus.net>
parents: 35681
diff changeset
   161
  (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469)
35522
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   162
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   163
  $ hg up 3
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   164
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
02fdb8c018aa update: support updating to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35501
diff changeset
   165
35681
e29823c6d3e8 update: fix crash on bare update when directaccess is enabled
Yuya Nishihara <yuya@tcha.org>
parents: 35611
diff changeset
   166
  $ hg up
e29823c6d3e8 update: fix crash on bare update when directaccess is enabled
Yuya Nishihara <yuya@tcha.org>
parents: 35611
diff changeset
   167
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
e29823c6d3e8 update: fix crash on bare update when directaccess is enabled
Yuya Nishihara <yuya@tcha.org>
parents: 35611
diff changeset
   168
35523
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   169
`hg revert`
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   170
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   171
  $ hg revert -r 28ad74 --all
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   172
  reverting c
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   173
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   174
  $ hg diff
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   175
  diff -r 2443a0e66469 c
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   176
  --- a/c	Thu Jan 01 00:00:00 1970 +0000
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   177
  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   178
  @@ -1,2 +1,1 @@
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   179
   foo
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   180
  -bar
31fe397f2bda revert: support reverting to hidden cset if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35522
diff changeset
   181
37097
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   182
Test special hash/rev
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   183
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   184
  $ hg log -qr 'null:wdir() & 000000000000'
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   185
  -1:000000000000
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   186
  $ hg log -qr 'null:wdir() & ffffffffffff'
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   187
  2147483647:ffffffffffff
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   188
  $ hg log -qr 'null:wdir() & rev(-1)'
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   189
  -1:000000000000
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   190
  $ hg log -qr 'null:wdir() & rev(2147483647)'
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   191
  2147483647:ffffffffffff
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   192
  $ hg log -qr 'null:wdir() & 2147483647'
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   193
  2147483647:ffffffffffff
7f025c9b7865 directaccess: do not abort by 'ff...' hash
Yuya Nishihara <yuya@tcha.org>
parents: 35712
diff changeset
   194
37716
dfc51a482031 registrar: replace "cmdtype" with an intent-based mechanism (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37097
diff changeset
   195
Commands with undefined intent should not work right now
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   197
  $ hg phase -r 28ad74
35571
265cd9e19d26 visibility: improve the message when accessing filtered obsolete rev
Boris Feld <boris.feld@octobus.net>
parents: 35539
diff changeset
   198
  abort: hidden revision '28ad74' was rewritten as: 2443a0e66469!
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  (use --hidden to access hidden revisions)
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  [255]
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   202
  $ hg phase -r 2
35571
265cd9e19d26 visibility: improve the message when accessing filtered obsolete rev
Boris Feld <boris.feld@octobus.net>
parents: 35539
diff changeset
   203
  abort: hidden revision '2' was rewritten as: 2443a0e66469!
35501
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   204
  (use --hidden to access hidden revisions)
b378a3d840ab commands: use the new API to access hidden changesets in various commands
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  [255]
35611
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   206
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   207
Setting a bookmark will make that changeset unhidden, so this should come in end
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   208
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   209
  $ hg bookmarks -r 28ad74 book
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   210
  bookmarking hidden changeset 28ad74487de9
35712
a1a5c3842b6f bookmarks: display the obsfate of hidden revision we create a bookmark on
Boris Feld <boris.feld@octobus.net>
parents: 35711
diff changeset
   211
  (hidden revision '28ad74487de9' was rewritten as: 2443a0e66469)
35611
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   212
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   213
  $ hg bookmarks
7336ac5e786e bookmarks: add bookmarks to hidden revs if directaccess config is set
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35571
diff changeset
   214
     book                      2:28ad74487de9