tests/test-amend-subrepo.t
author Gregory Szorc <gregory.szorc@gmail.com>
Tue, 28 Aug 2018 15:02:48 -0700
changeset 39411 aeb551a3bb8a
parent 35393 4441705b7111
child 41977 4ea21df312ec
permissions -rw-r--r--
cborutil: implement sans I/O decoder The vendored CBOR package decodes by calling read(n) on an object. There are a number of disadvantages to this: * Uses blocking I/O. If sufficient data is not available, the decoder will hang until it is. * No support for partial reads. If the read(n) returns less data than requested, the decoder raises an error. * Requires the use of a file like object. If the original data is in say a buffer, we need to "cast" it to e.g. a BytesIO to appease the decoder. In addition, the vendored CBOR decoder doesn't provide flexibility that we desire. Specifically: * It buffers indefinite length bytestrings instead of streaming them. * It doesn't allow limiting the set of types that can be decoded. This property is useful when implementing a "hardened" decoder that is less susceptible to abusive input. * It doesn't provide sufficient "hook points" and introspection to institute checks around behavior. These are useful for implementing a "hardened" decoder. This all adds up to a reasonable set of justifications for writing our own decoder. So, this commit implements our own CBOR decoder. At the heart of the decoder is a function that decodes a single "item" from a buffer. This item can be a complete simple value or a special value, such as "start of array." Using this function, we can build a decoder that effectively iterates over the stream of decoded items and builds up higher-level values, such as arrays, maps, sets, and indefinite length bytestrings. And we can do this without performing I/O in the decoder itself. The core of the sans I/O decoder will probably not be used directly. Instead, it is expected that we'll build utility functions for invoking the decoder given specific input types. This will allow extreme flexibility in how data is delivered to the decoder. I'm pretty happy with the state of the decoder modulo the TODO items to track wanted features to help with a "hardened" decoder. The one thing I could be convinced to change is the handling of semantic tags. Since we only support a single semantic tag (sets), I thought it would be easier to handle them inline in decodeitem(). This is simpler now. But if we add support for other semantic tags, it will likely be easier to move semantic tag handling outside of decodeitem(). But, properly supporting semantic tags opens up a whole can of worms, as many semantic tags imply new types. I'm optimistic we won't need these in Mercurial. But who knows. I'm also pretty happy with the test coverage. Writing comprehensive tests for partial decoding did flush out a handful of bugs. One general improvement to testing would be fuzz testing for partial decoding. I may implement that later. I also anticipate switching the wire protocol code to this new decoder will flush out any lingering bugs. Differential Revision: https://phab.mercurial-scm.org/D4414
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     1
#testcases obsstore-off obsstore-on
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     2
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     4
  > [extensions]
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     5
  > amend =
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     6
  > EOF
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     7
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     8
#if obsstore-on
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
     9
  $ cat << EOF >> $HGRCPATH
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    10
  > [experimental]
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    11
  > evolution.createmarkers = True
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    12
  > EOF
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    13
#endif
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    14
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    15
Prepare parent repo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    16
-------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    17
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    18
  $ hg init r
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    19
  $ cd r
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    20
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    21
  $ echo a > a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    22
  $ hg ci -Am0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    23
  adding a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    24
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    25
Link first subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    26
------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    27
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    28
  $ echo 's = s' >> .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    29
  $ hg add .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    30
  $ hg init s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    31
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    32
amend without .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    33
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    34
  $ hg amend s
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    35
  abort: can't commit subrepos without .hgsub
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    36
  [255]
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    37
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    38
amend with subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    39
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    40
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    41
  saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    42
  $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    43
  A .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    44
  A .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    45
  A a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    46
  $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    47
  0000000000000000000000000000000000000000 s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    48
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    49
Update subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    50
--------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    51
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    52
add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    53
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    54
  $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    55
  $ hg ci -m1
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    56
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    57
amend with dirty subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    58
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    59
  $ echo a >> s/a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    60
  $ hg add -R s
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35166
diff changeset
    61
  adding s/a
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    62
  $ hg amend
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    63
  abort: uncommitted changes in subrepository "s"
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    64
  (use --subrepos for recursive commit)
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    65
  [255]
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    66
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    67
amend with modified subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    68
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    69
  $ hg ci -R s -m0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    70
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    71
  saved backup bundle to * (glob) (obsstore-off !)
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    72
  $ hg status --change .
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    73
  M .hgsubstate
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
    74
  M a
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    75
  $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    76
  f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    77
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    78
revert subrepo change
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    79
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    80
  $ hg up -R s -q null
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    81
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    82
  saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    83
  $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    84
  M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    85
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    86
Link another subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    87
--------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    88
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    89
add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    90
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    91
  $ echo b >> b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    92
  $ hg ci -qAm2
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    93
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    94
also checks if non-subrepo change is included
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    95
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    96
  $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    97
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    98
amend with another subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
    99
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   100
  $ hg init t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   101
  $ echo b >> t/b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   102
  $ hg ci -R t -Am0
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   103
  adding b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   104
  $ echo 't = t' >> .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   105
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   106
  saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   107
  $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   108
  M .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
   109
  M .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   110
  M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   111
  A b
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   112
  $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   113
  0000000000000000000000000000000000000000 s
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   114
  bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   115
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   116
Unlink one subrepo
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   117
------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   118
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   119
add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   120
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   121
  $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   122
  $ hg ci -m3
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   123
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   124
amend with one subrepo dropped
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   125
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   126
  $ echo 't = t' > .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   127
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   128
  saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   129
  $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   130
  M .hgsub
35026
691524f0bbf6 amend: update .hgsubstate before committing a memctx (issue5677)
Yuya Nishihara <yuya@tcha.org>
parents: 35024
diff changeset
   131
  M .hgsubstate
35024
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   132
  M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   133
  $ cat .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   134
  bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   135
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   136
Unlink subrepos completely
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   137
--------------------------
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   138
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   139
add new commit to be amended
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   140
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   141
  $ echo a >> a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   142
  $ hg ci -m3
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   143
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   144
amend with .hgsub removed
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   145
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   146
  $ hg rm .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   147
  $ hg amend
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   148
  saved backup bundle to * (glob) (obsstore-off !)
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   149
  $ hg status --change .
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   150
  M a
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   151
  R .hgsub
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   152
  R .hgsubstate
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   153
3f909147a2c3 tests: demonstrate that .hgsubstate isn't updated on amend
Yuya Nishihara <yuya@tcha.org>
parents:
diff changeset
   154
  $ cd ..