tests/test-amend-subrepo.t
branchstable
changeset 35026 691524f0bbf6
parent 35024 3f909147a2c3
child 35166 ba6324ee49e9
equal deleted inserted replaced
35025:5c6b96b832c2 35026:691524f0bbf6
    29   $ hg add .hgsub
    29   $ hg add .hgsub
    30   $ hg init s
    30   $ hg init s
    31 
    31 
    32 amend without .hgsub
    32 amend without .hgsub
    33 
    33 
    34 BROKEN: should say "can't commit subrepos without .hgsub"
       
    35   $ hg amend s
    34   $ hg amend s
    36   nothing changed
    35   abort: can't commit subrepos without .hgsub
    37   [1]
    36   [255]
    38 
    37 
    39 amend with subrepo
    38 amend with subrepo
    40 
    39 
    41 BROKEN: should update .hgsubstate
       
    42   $ hg amend
    40   $ hg amend
    43   saved backup bundle to * (glob) (obsstore-off !)
    41   saved backup bundle to * (glob) (obsstore-off !)
    44   $ hg status --change .
    42   $ hg status --change .
    45   A .hgsub
    43   A .hgsub
       
    44   A .hgsubstate
    46   A a
    45   A a
    47 
       
    48 FIX UP .hgsubstate
       
    49 
       
    50   $ hg ci -mfix
       
    51   $ hg rollback -q
       
    52   $ hg add .hgsubstate
       
    53   $ hg amend
       
    54   saved backup bundle to * (glob) (obsstore-off !)
       
    55 
       
    56   $ cat .hgsubstate
    46   $ cat .hgsubstate
    57   0000000000000000000000000000000000000000 s
    47   0000000000000000000000000000000000000000 s
    58 
    48 
    59 Update subrepo
    49 Update subrepo
    60 --------------
    50 --------------
    67 amend with dirty subrepo
    57 amend with dirty subrepo
    68 
    58 
    69   $ echo a >> s/a
    59   $ echo a >> s/a
    70   $ hg add -R s
    60   $ hg add -R s
    71   adding s/a
    61   adding s/a
    72 BROKEN: should say "uncommitted changes in subrepository"
       
    73   $ hg amend
    62   $ hg amend
    74   nothing changed
    63   abort: uncommitted changes in subrepository "s"
    75   [1]
    64   (use --subrepos for recursive commit)
       
    65   [255]
    76 
    66 
    77 amend with modified subrepo
    67 amend with modified subrepo
    78 
    68 
    79   $ hg ci -R s -m0
    69   $ hg ci -R s -m0
    80 BROKEN: should update .hgsubstate
       
    81   $ hg amend
       
    82   nothing changed
       
    83   [1]
       
    84   $ hg status --change .
       
    85   M a
       
    86 
       
    87 FIX UP .hgsubstate
       
    88 
       
    89   $ hg ci -mfix
       
    90   $ hg rollback -q
       
    91   $ hg amend
    70   $ hg amend
    92   saved backup bundle to * (glob) (obsstore-off !)
    71   saved backup bundle to * (glob) (obsstore-off !)
    93 
    72   $ hg status --change .
       
    73   M .hgsubstate
       
    74   M a
    94   $ cat .hgsubstate
    75   $ cat .hgsubstate
    95   f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s
    76   f7b1eb17ad24730a1651fccd46c43826d1bbc2ac s
    96 
    77 
    97 revert subrepo change
    78 revert subrepo change
    98 
    79 
    99   $ hg up -R s -q null
    80   $ hg up -R s -q null
   100 BROKEN: should update .hgsubstate
       
   101   $ hg amend
       
   102   nothing changed
       
   103   [1]
       
   104 
       
   105 FIX UP .hgsubstate
       
   106 
       
   107   $ hg ci -mfix
       
   108   $ hg rollback -q
       
   109   $ hg amend
    81   $ hg amend
   110   saved backup bundle to * (glob) (obsstore-off !)
    82   saved backup bundle to * (glob) (obsstore-off !)
   111 
       
   112   $ hg status --change .
    83   $ hg status --change .
   113   M a
    84   M a
   114 
    85 
   115 Link another subrepo
    86 Link another subrepo
   116 --------------------
    87 --------------------
   129   $ hg init t
   100   $ hg init t
   130   $ echo b >> t/b
   101   $ echo b >> t/b
   131   $ hg ci -R t -Am0
   102   $ hg ci -R t -Am0
   132   adding b
   103   adding b
   133   $ echo 't = t' >> .hgsub
   104   $ echo 't = t' >> .hgsub
   134 BROKEN: should update .hgsubstate
       
   135   $ hg amend
   105   $ hg amend
   136   saved backup bundle to * (glob) (obsstore-off !)
   106   saved backup bundle to * (glob) (obsstore-off !)
   137   $ hg status --change .
   107   $ hg status --change .
   138   M .hgsub
   108   M .hgsub
       
   109   M .hgsubstate
   139   M a
   110   M a
   140   A b
   111   A b
   141 
       
   142 FIX UP .hgsubstate
       
   143 
       
   144   $ hg ci -mfix
       
   145   $ hg rollback -q
       
   146   $ hg amend
       
   147   saved backup bundle to * (glob) (obsstore-off !)
       
   148 
       
   149   $ cat .hgsubstate
   112   $ cat .hgsubstate
   150   0000000000000000000000000000000000000000 s
   113   0000000000000000000000000000000000000000 s
   151   bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
   114   bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
   152 
   115 
   153 Unlink one subrepo
   116 Unlink one subrepo
   159   $ hg ci -m3
   122   $ hg ci -m3
   160 
   123 
   161 amend with one subrepo dropped
   124 amend with one subrepo dropped
   162 
   125 
   163   $ echo 't = t' > .hgsub
   126   $ echo 't = t' > .hgsub
   164 BROKEN: should update .hgsubstate
       
   165   $ hg amend
   127   $ hg amend
   166   saved backup bundle to * (glob) (obsstore-off !)
   128   saved backup bundle to * (glob) (obsstore-off !)
   167   $ hg status --change .
   129   $ hg status --change .
   168   M .hgsub
   130   M .hgsub
       
   131   M .hgsubstate
   169   M a
   132   M a
   170 
       
   171 FIX UP .hgsubstate
       
   172 
       
   173   $ echo 's = s' > .hgsub
       
   174   $ hg amend -q
       
   175   $ echo 't = t' > .hgsub
       
   176   $ hg ci -mfix
       
   177   $ hg rollback -q
       
   178   $ hg amend
       
   179   saved backup bundle to * (glob) (obsstore-off !)
       
   180 
       
   181   $ cat .hgsubstate
   133   $ cat .hgsubstate
   182   bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
   134   bfb1a4fb358498a9533dabf4f2043d94162f1fcd t
   183 
   135 
   184 Unlink subrepos completely
   136 Unlink subrepos completely
   185 --------------------------
   137 --------------------------
   190   $ hg ci -m3
   142   $ hg ci -m3
   191 
   143 
   192 amend with .hgsub removed
   144 amend with .hgsub removed
   193 
   145 
   194   $ hg rm .hgsub
   146   $ hg rm .hgsub
   195 BROKEN: should update .hgsubstate
       
   196   $ hg amend
   147   $ hg amend
   197   saved backup bundle to * (glob) (obsstore-off !)
   148   saved backup bundle to * (glob) (obsstore-off !)
   198   $ hg status --change .
       
   199   M a
       
   200   R .hgsub
       
   201 
       
   202 FIX UP .hgsubstate
       
   203 
       
   204   $ hg forget .hgsubstate
       
   205   $ hg amend
       
   206   saved backup bundle to * (glob) (obsstore-off !)
       
   207 
       
   208   $ hg status --change .
   149   $ hg status --change .
   209   M a
   150   M a
   210   R .hgsub
   151   R .hgsub
   211   R .hgsubstate
   152   R .hgsubstate
   212 
   153