tests/test-mv-cp-st-diff.t
changeset 12469 be6d33671c95
parent 10179 83cfa1baf8ad
child 15447 9910f60a37ee
equal deleted inserted replaced
12468:d8bf747d2e29 12469:be6d33671c95
       
     1 
       
     2   $ add()
       
     3   > {
       
     4   >     echo $2 >> $1
       
     5   > }
       
     6   $ hg init t
       
     7   $ cd t
       
     8 
       
     9 set up a boring main branch
       
    10 
       
    11   $ add a a
       
    12   $ hg add a
       
    13   $ mkdir x
       
    14   $ add x/x x
       
    15   $ hg add x/x
       
    16   $ hg ci -m0
       
    17   $ add a m1
       
    18   $ hg ci -m1
       
    19   $ add a m2
       
    20   $ add x/y y1
       
    21   $ hg add x/y
       
    22   $ hg ci -m2
       
    23   $ cd ..
       
    24   $ show()
       
    25   > {
       
    26   >     echo "- $2: $1"
       
    27   >     hg st -C $1
       
    28   >     echo
       
    29   >     hg diff --git $1
       
    30   >     echo
       
    31   > }
       
    32   $ count=0
       
    33 
       
    34 make a new branch and get diff/status output
       
    35 $1 - first commit
       
    36 $2 - second commit
       
    37 $3 - working dir action
       
    38 $4 - test description
       
    39 
       
    40   $ tb()
       
    41   > {
       
    42   >     hg clone t t2 ; cd t2
       
    43   >     hg co -q -C 0
       
    44   > 
       
    45   >     add a $count
       
    46   >     count=`expr $count + 1`
       
    47   >     hg ci -m "t0"
       
    48   >     $1
       
    49   >     hg ci -m "t1"
       
    50   >     $2
       
    51   >     hg ci -m "t2"
       
    52   >     $3
       
    53   > 
       
    54   >     echo "** $4 **"
       
    55   >     echo "** $1 / $2 / $3"
       
    56   >     show "" "working to parent"
       
    57   >     show "--rev 0" "working to root"
       
    58   >     show "--rev 2" "working to branch"
       
    59   >     show "--rev 0 --rev ." "root to parent"
       
    60   >     show "--rev . --rev 0" "parent to root"
       
    61   >     show "--rev 2 --rev ." "branch to parent"
       
    62   >     show "--rev . --rev 2" "parent to branch"
       
    63   >     echo
       
    64   >     cd ..
       
    65   >     rm -rf t2
       
    66   > }
       
    67   $ tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
       
    68   updating to branch default
       
    69   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    70   created new head
       
    71   ** rename in working dir **
       
    72   ** add a a1 / add a a2 / hg mv a b
       
    73   - working to parent: 
       
    74   A b
       
    75     a
       
    76   R a
       
    77   
       
    78   diff --git a/a b/b
       
    79   rename from a
       
    80   rename to b
       
    81   
       
    82   - working to root: --rev 0
       
    83   A b
       
    84     a
       
    85   R a
       
    86   
       
    87   diff --git a/a b/b
       
    88   rename from a
       
    89   rename to b
       
    90   --- a/a
       
    91   +++ b/b
       
    92   @@ -1,1 +1,4 @@
       
    93    a
       
    94   +0
       
    95   +a1
       
    96   +a2
       
    97   
       
    98   - working to branch: --rev 2
       
    99   A b
       
   100     a
       
   101   R a
       
   102   R x/y
       
   103   
       
   104   diff --git a/a b/b
       
   105   rename from a
       
   106   rename to b
       
   107   --- a/a
       
   108   +++ b/b
       
   109   @@ -1,3 +1,4 @@
       
   110    a
       
   111   -m1
       
   112   -m2
       
   113   +0
       
   114   +a1
       
   115   +a2
       
   116   diff --git a/x/y b/x/y
       
   117   deleted file mode 100644
       
   118   --- a/x/y
       
   119   +++ /dev/null
       
   120   @@ -1,1 +0,0 @@
       
   121   -y1
       
   122   
       
   123   - root to parent: --rev 0 --rev .
       
   124   M a
       
   125   
       
   126   diff --git a/a b/a
       
   127   --- a/a
       
   128   +++ b/a
       
   129   @@ -1,1 +1,4 @@
       
   130    a
       
   131   +0
       
   132   +a1
       
   133   +a2
       
   134   
       
   135   - parent to root: --rev . --rev 0
       
   136   M a
       
   137   
       
   138   diff --git a/a b/a
       
   139   --- a/a
       
   140   +++ b/a
       
   141   @@ -1,4 +1,1 @@
       
   142    a
       
   143   -0
       
   144   -a1
       
   145   -a2
       
   146   
       
   147   - branch to parent: --rev 2 --rev .
       
   148   M a
       
   149   R x/y
       
   150   
       
   151   diff --git a/a b/a
       
   152   --- a/a
       
   153   +++ b/a
       
   154   @@ -1,3 +1,4 @@
       
   155    a
       
   156   -m1
       
   157   -m2
       
   158   +0
       
   159   +a1
       
   160   +a2
       
   161   diff --git a/x/y b/x/y
       
   162   deleted file mode 100644
       
   163   --- a/x/y
       
   164   +++ /dev/null
       
   165   @@ -1,1 +0,0 @@
       
   166   -y1
       
   167   
       
   168   - parent to branch: --rev . --rev 2
       
   169   M a
       
   170   A x/y
       
   171   
       
   172   diff --git a/a b/a
       
   173   --- a/a
       
   174   +++ b/a
       
   175   @@ -1,4 +1,3 @@
       
   176    a
       
   177   -0
       
   178   -a1
       
   179   -a2
       
   180   +m1
       
   181   +m2
       
   182   diff --git a/x/y b/x/y
       
   183   new file mode 100644
       
   184   --- /dev/null
       
   185   +++ b/x/y
       
   186   @@ -0,0 +1,1 @@
       
   187   +y1
       
   188   
       
   189   
       
   190   $ tb "add a a1" "add a a2" "hg cp a b" "copy in working dir" 
       
   191   updating to branch default
       
   192   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   193   created new head
       
   194   ** copy in working dir **
       
   195   ** add a a1 / add a a2 / hg cp a b
       
   196   - working to parent: 
       
   197   A b
       
   198     a
       
   199   
       
   200   diff --git a/a b/b
       
   201   copy from a
       
   202   copy to b
       
   203   
       
   204   - working to root: --rev 0
       
   205   M a
       
   206   A b
       
   207     a
       
   208   
       
   209   diff --git a/a b/a
       
   210   --- a/a
       
   211   +++ b/a
       
   212   @@ -1,1 +1,4 @@
       
   213    a
       
   214   +1
       
   215   +a1
       
   216   +a2
       
   217   diff --git a/a b/b
       
   218   copy from a
       
   219   copy to b
       
   220   --- a/a
       
   221   +++ b/b
       
   222   @@ -1,1 +1,4 @@
       
   223    a
       
   224   +1
       
   225   +a1
       
   226   +a2
       
   227   
       
   228   - working to branch: --rev 2
       
   229   M a
       
   230   A b
       
   231     a
       
   232   R x/y
       
   233   
       
   234   diff --git a/a b/a
       
   235   --- a/a
       
   236   +++ b/a
       
   237   @@ -1,3 +1,4 @@
       
   238    a
       
   239   -m1
       
   240   -m2
       
   241   +1
       
   242   +a1
       
   243   +a2
       
   244   diff --git a/a b/b
       
   245   copy from a
       
   246   copy to b
       
   247   --- a/a
       
   248   +++ b/b
       
   249   @@ -1,3 +1,4 @@
       
   250    a
       
   251   -m1
       
   252   -m2
       
   253   +1
       
   254   +a1
       
   255   +a2
       
   256   diff --git a/x/y b/x/y
       
   257   deleted file mode 100644
       
   258   --- a/x/y
       
   259   +++ /dev/null
       
   260   @@ -1,1 +0,0 @@
       
   261   -y1
       
   262   
       
   263   - root to parent: --rev 0 --rev .
       
   264   M a
       
   265   
       
   266   diff --git a/a b/a
       
   267   --- a/a
       
   268   +++ b/a
       
   269   @@ -1,1 +1,4 @@
       
   270    a
       
   271   +1
       
   272   +a1
       
   273   +a2
       
   274   
       
   275   - parent to root: --rev . --rev 0
       
   276   M a
       
   277   
       
   278   diff --git a/a b/a
       
   279   --- a/a
       
   280   +++ b/a
       
   281   @@ -1,4 +1,1 @@
       
   282    a
       
   283   -1
       
   284   -a1
       
   285   -a2
       
   286   
       
   287   - branch to parent: --rev 2 --rev .
       
   288   M a
       
   289   R x/y
       
   290   
       
   291   diff --git a/a b/a
       
   292   --- a/a
       
   293   +++ b/a
       
   294   @@ -1,3 +1,4 @@
       
   295    a
       
   296   -m1
       
   297   -m2
       
   298   +1
       
   299   +a1
       
   300   +a2
       
   301   diff --git a/x/y b/x/y
       
   302   deleted file mode 100644
       
   303   --- a/x/y
       
   304   +++ /dev/null
       
   305   @@ -1,1 +0,0 @@
       
   306   -y1
       
   307   
       
   308   - parent to branch: --rev . --rev 2
       
   309   M a
       
   310   A x/y
       
   311   
       
   312   diff --git a/a b/a
       
   313   --- a/a
       
   314   +++ b/a
       
   315   @@ -1,4 +1,3 @@
       
   316    a
       
   317   -1
       
   318   -a1
       
   319   -a2
       
   320   +m1
       
   321   +m2
       
   322   diff --git a/x/y b/x/y
       
   323   new file mode 100644
       
   324   --- /dev/null
       
   325   +++ b/x/y
       
   326   @@ -0,0 +1,1 @@
       
   327   +y1
       
   328   
       
   329   
       
   330   $ tb "hg mv a b" "add b b1" "add b w" "single rename"
       
   331   updating to branch default
       
   332   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   333   created new head
       
   334   ** single rename **
       
   335   ** hg mv a b / add b b1 / add b w
       
   336   - working to parent: 
       
   337   M b
       
   338   
       
   339   diff --git a/b b/b
       
   340   --- a/b
       
   341   +++ b/b
       
   342   @@ -1,3 +1,4 @@
       
   343    a
       
   344    2
       
   345    b1
       
   346   +w
       
   347   
       
   348   - working to root: --rev 0
       
   349   A b
       
   350     a
       
   351   R a
       
   352   
       
   353   diff --git a/a b/b
       
   354   rename from a
       
   355   rename to b
       
   356   --- a/a
       
   357   +++ b/b
       
   358   @@ -1,1 +1,4 @@
       
   359    a
       
   360   +2
       
   361   +b1
       
   362   +w
       
   363   
       
   364   - working to branch: --rev 2
       
   365   A b
       
   366     a
       
   367   R a
       
   368   R x/y
       
   369   
       
   370   diff --git a/a b/b
       
   371   rename from a
       
   372   rename to b
       
   373   --- a/a
       
   374   +++ b/b
       
   375   @@ -1,3 +1,4 @@
       
   376    a
       
   377   -m1
       
   378   -m2
       
   379   +2
       
   380   +b1
       
   381   +w
       
   382   diff --git a/x/y b/x/y
       
   383   deleted file mode 100644
       
   384   --- a/x/y
       
   385   +++ /dev/null
       
   386   @@ -1,1 +0,0 @@
       
   387   -y1
       
   388   
       
   389   - root to parent: --rev 0 --rev .
       
   390   A b
       
   391     a
       
   392   R a
       
   393   
       
   394   diff --git a/a b/b
       
   395   rename from a
       
   396   rename to b
       
   397   --- a/a
       
   398   +++ b/b
       
   399   @@ -1,1 +1,3 @@
       
   400    a
       
   401   +2
       
   402   +b1
       
   403   
       
   404   - parent to root: --rev . --rev 0
       
   405   A a
       
   406     b
       
   407   R b
       
   408   
       
   409   diff --git a/b b/a
       
   410   rename from b
       
   411   rename to a
       
   412   --- a/b
       
   413   +++ b/a
       
   414   @@ -1,3 +1,1 @@
       
   415    a
       
   416   -2
       
   417   -b1
       
   418   
       
   419   - branch to parent: --rev 2 --rev .
       
   420   A b
       
   421     a
       
   422   R a
       
   423   R x/y
       
   424   
       
   425   diff --git a/a b/b
       
   426   rename from a
       
   427   rename to b
       
   428   --- a/a
       
   429   +++ b/b
       
   430   @@ -1,3 +1,3 @@
       
   431    a
       
   432   -m1
       
   433   -m2
       
   434   +2
       
   435   +b1
       
   436   diff --git a/x/y b/x/y
       
   437   deleted file mode 100644
       
   438   --- a/x/y
       
   439   +++ /dev/null
       
   440   @@ -1,1 +0,0 @@
       
   441   -y1
       
   442   
       
   443   - parent to branch: --rev . --rev 2
       
   444   A a
       
   445     b
       
   446   A x/y
       
   447   R b
       
   448   
       
   449   diff --git a/b b/a
       
   450   rename from b
       
   451   rename to a
       
   452   --- a/b
       
   453   +++ b/a
       
   454   @@ -1,3 +1,3 @@
       
   455    a
       
   456   -2
       
   457   -b1
       
   458   +m1
       
   459   +m2
       
   460   diff --git a/x/y b/x/y
       
   461   new file mode 100644
       
   462   --- /dev/null
       
   463   +++ b/x/y
       
   464   @@ -0,0 +1,1 @@
       
   465   +y1
       
   466   
       
   467   
       
   468   $ tb "hg cp a b" "add b b1" "add a w" "single copy"
       
   469   updating to branch default
       
   470   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   471   created new head
       
   472   ** single copy **
       
   473   ** hg cp a b / add b b1 / add a w
       
   474   - working to parent: 
       
   475   M a
       
   476   
       
   477   diff --git a/a b/a
       
   478   --- a/a
       
   479   +++ b/a
       
   480   @@ -1,2 +1,3 @@
       
   481    a
       
   482    3
       
   483   +w
       
   484   
       
   485   - working to root: --rev 0
       
   486   M a
       
   487   A b
       
   488     a
       
   489   
       
   490   diff --git a/a b/a
       
   491   --- a/a
       
   492   +++ b/a
       
   493   @@ -1,1 +1,3 @@
       
   494    a
       
   495   +3
       
   496   +w
       
   497   diff --git a/a b/b
       
   498   copy from a
       
   499   copy to b
       
   500   --- a/a
       
   501   +++ b/b
       
   502   @@ -1,1 +1,3 @@
       
   503    a
       
   504   +3
       
   505   +b1
       
   506   
       
   507   - working to branch: --rev 2
       
   508   M a
       
   509   A b
       
   510     a
       
   511   R x/y
       
   512   
       
   513   diff --git a/a b/a
       
   514   --- a/a
       
   515   +++ b/a
       
   516   @@ -1,3 +1,3 @@
       
   517    a
       
   518   -m1
       
   519   -m2
       
   520   +3
       
   521   +w
       
   522   diff --git a/a b/b
       
   523   copy from a
       
   524   copy to b
       
   525   --- a/a
       
   526   +++ b/b
       
   527   @@ -1,3 +1,3 @@
       
   528    a
       
   529   -m1
       
   530   -m2
       
   531   +3
       
   532   +b1
       
   533   diff --git a/x/y b/x/y
       
   534   deleted file mode 100644
       
   535   --- a/x/y
       
   536   +++ /dev/null
       
   537   @@ -1,1 +0,0 @@
       
   538   -y1
       
   539   
       
   540   - root to parent: --rev 0 --rev .
       
   541   M a
       
   542   A b
       
   543     a
       
   544   
       
   545   diff --git a/a b/a
       
   546   --- a/a
       
   547   +++ b/a
       
   548   @@ -1,1 +1,2 @@
       
   549    a
       
   550   +3
       
   551   diff --git a/a b/b
       
   552   copy from a
       
   553   copy to b
       
   554   --- a/a
       
   555   +++ b/b
       
   556   @@ -1,1 +1,3 @@
       
   557    a
       
   558   +3
       
   559   +b1
       
   560   
       
   561   - parent to root: --rev . --rev 0
       
   562   M a
       
   563   R b
       
   564   
       
   565   diff --git a/a b/a
       
   566   --- a/a
       
   567   +++ b/a
       
   568   @@ -1,2 +1,1 @@
       
   569    a
       
   570   -3
       
   571   diff --git a/b b/b
       
   572   deleted file mode 100644
       
   573   --- a/b
       
   574   +++ /dev/null
       
   575   @@ -1,3 +0,0 @@
       
   576   -a
       
   577   -3
       
   578   -b1
       
   579   
       
   580   - branch to parent: --rev 2 --rev .
       
   581   M a
       
   582   A b
       
   583     a
       
   584   R x/y
       
   585   
       
   586   diff --git a/a b/a
       
   587   --- a/a
       
   588   +++ b/a
       
   589   @@ -1,3 +1,2 @@
       
   590    a
       
   591   -m1
       
   592   -m2
       
   593   +3
       
   594   diff --git a/a b/b
       
   595   copy from a
       
   596   copy to b
       
   597   --- a/a
       
   598   +++ b/b
       
   599   @@ -1,3 +1,3 @@
       
   600    a
       
   601   -m1
       
   602   -m2
       
   603   +3
       
   604   +b1
       
   605   diff --git a/x/y b/x/y
       
   606   deleted file mode 100644
       
   607   --- a/x/y
       
   608   +++ /dev/null
       
   609   @@ -1,1 +0,0 @@
       
   610   -y1
       
   611   
       
   612   - parent to branch: --rev . --rev 2
       
   613   M a
       
   614   A x/y
       
   615   R b
       
   616   
       
   617   diff --git a/a b/a
       
   618   --- a/a
       
   619   +++ b/a
       
   620   @@ -1,2 +1,3 @@
       
   621    a
       
   622   -3
       
   623   +m1
       
   624   +m2
       
   625   diff --git a/b b/b
       
   626   deleted file mode 100644
       
   627   --- a/b
       
   628   +++ /dev/null
       
   629   @@ -1,3 +0,0 @@
       
   630   -a
       
   631   -3
       
   632   -b1
       
   633   diff --git a/x/y b/x/y
       
   634   new file mode 100644
       
   635   --- /dev/null
       
   636   +++ b/x/y
       
   637   @@ -0,0 +1,1 @@
       
   638   +y1
       
   639   
       
   640   
       
   641   $ tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
       
   642   updating to branch default
       
   643   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   644   created new head
       
   645   ** rename chain **
       
   646   ** hg mv a b / hg mv b c / hg mv c d
       
   647   - working to parent: 
       
   648   A d
       
   649     c
       
   650   R c
       
   651   
       
   652   diff --git a/c b/d
       
   653   rename from c
       
   654   rename to d
       
   655   
       
   656   - working to root: --rev 0
       
   657   A d
       
   658     a
       
   659   R a
       
   660   
       
   661   diff --git a/a b/d
       
   662   rename from a
       
   663   rename to d
       
   664   --- a/a
       
   665   +++ b/d
       
   666   @@ -1,1 +1,2 @@
       
   667    a
       
   668   +4
       
   669   
       
   670   - working to branch: --rev 2
       
   671   A d
       
   672     a
       
   673   R a
       
   674   R x/y
       
   675   
       
   676   diff --git a/a b/d
       
   677   rename from a
       
   678   rename to d
       
   679   --- a/a
       
   680   +++ b/d
       
   681   @@ -1,3 +1,2 @@
       
   682    a
       
   683   -m1
       
   684   -m2
       
   685   +4
       
   686   diff --git a/x/y b/x/y
       
   687   deleted file mode 100644
       
   688   --- a/x/y
       
   689   +++ /dev/null
       
   690   @@ -1,1 +0,0 @@
       
   691   -y1
       
   692   
       
   693   - root to parent: --rev 0 --rev .
       
   694   A c
       
   695     a
       
   696   R a
       
   697   
       
   698   diff --git a/a b/c
       
   699   rename from a
       
   700   rename to c
       
   701   --- a/a
       
   702   +++ b/c
       
   703   @@ -1,1 +1,2 @@
       
   704    a
       
   705   +4
       
   706   
       
   707   - parent to root: --rev . --rev 0
       
   708   A a
       
   709     c
       
   710   R c
       
   711   
       
   712   diff --git a/c b/a
       
   713   rename from c
       
   714   rename to a
       
   715   --- a/c
       
   716   +++ b/a
       
   717   @@ -1,2 +1,1 @@
       
   718    a
       
   719   -4
       
   720   
       
   721   - branch to parent: --rev 2 --rev .
       
   722   A c
       
   723     a
       
   724   R a
       
   725   R x/y
       
   726   
       
   727   diff --git a/a b/c
       
   728   rename from a
       
   729   rename to c
       
   730   --- a/a
       
   731   +++ b/c
       
   732   @@ -1,3 +1,2 @@
       
   733    a
       
   734   -m1
       
   735   -m2
       
   736   +4
       
   737   diff --git a/x/y b/x/y
       
   738   deleted file mode 100644
       
   739   --- a/x/y
       
   740   +++ /dev/null
       
   741   @@ -1,1 +0,0 @@
       
   742   -y1
       
   743   
       
   744   - parent to branch: --rev . --rev 2
       
   745   A a
       
   746     c
       
   747   A x/y
       
   748   R c
       
   749   
       
   750   diff --git a/c b/a
       
   751   rename from c
       
   752   rename to a
       
   753   --- a/c
       
   754   +++ b/a
       
   755   @@ -1,2 +1,3 @@
       
   756    a
       
   757   -4
       
   758   +m1
       
   759   +m2
       
   760   diff --git a/x/y b/x/y
       
   761   new file mode 100644
       
   762   --- /dev/null
       
   763   +++ b/x/y
       
   764   @@ -0,0 +1,1 @@
       
   765   +y1
       
   766   
       
   767   
       
   768   $ tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
       
   769   updating to branch default
       
   770   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   771   created new head
       
   772   ** copy chain **
       
   773   ** hg cp a b / hg cp b c / hg cp c d
       
   774   - working to parent: 
       
   775   A d
       
   776     c
       
   777   
       
   778   diff --git a/c b/d
       
   779   copy from c
       
   780   copy to d
       
   781   
       
   782   - working to root: --rev 0
       
   783   M a
       
   784   A b
       
   785     a
       
   786   A c
       
   787     a
       
   788   A d
       
   789     a
       
   790   
       
   791   diff --git a/a b/a
       
   792   --- a/a
       
   793   +++ b/a
       
   794   @@ -1,1 +1,2 @@
       
   795    a
       
   796   +5
       
   797   diff --git a/a b/b
       
   798   copy from a
       
   799   copy to b
       
   800   --- a/a
       
   801   +++ b/b
       
   802   @@ -1,1 +1,2 @@
       
   803    a
       
   804   +5
       
   805   diff --git a/a b/c
       
   806   copy from a
       
   807   copy to c
       
   808   --- a/a
       
   809   +++ b/c
       
   810   @@ -1,1 +1,2 @@
       
   811    a
       
   812   +5
       
   813   diff --git a/a b/d
       
   814   copy from a
       
   815   copy to d
       
   816   --- a/a
       
   817   +++ b/d
       
   818   @@ -1,1 +1,2 @@
       
   819    a
       
   820   +5
       
   821   
       
   822   - working to branch: --rev 2
       
   823   M a
       
   824   A b
       
   825     a
       
   826   A c
       
   827     a
       
   828   A d
       
   829     a
       
   830   R x/y
       
   831   
       
   832   diff --git a/a b/a
       
   833   --- a/a
       
   834   +++ b/a
       
   835   @@ -1,3 +1,2 @@
       
   836    a
       
   837   -m1
       
   838   -m2
       
   839   +5
       
   840   diff --git a/a b/b
       
   841   copy from a
       
   842   copy to b
       
   843   --- a/a
       
   844   +++ b/b
       
   845   @@ -1,3 +1,2 @@
       
   846    a
       
   847   -m1
       
   848   -m2
       
   849   +5
       
   850   diff --git a/a b/c
       
   851   copy from a
       
   852   copy to c
       
   853   --- a/a
       
   854   +++ b/c
       
   855   @@ -1,3 +1,2 @@
       
   856    a
       
   857   -m1
       
   858   -m2
       
   859   +5
       
   860   diff --git a/a b/d
       
   861   copy from a
       
   862   copy to d
       
   863   --- a/a
       
   864   +++ b/d
       
   865   @@ -1,3 +1,2 @@
       
   866    a
       
   867   -m1
       
   868   -m2
       
   869   +5
       
   870   diff --git a/x/y b/x/y
       
   871   deleted file mode 100644
       
   872   --- a/x/y
       
   873   +++ /dev/null
       
   874   @@ -1,1 +0,0 @@
       
   875   -y1
       
   876   
       
   877   - root to parent: --rev 0 --rev .
       
   878   M a
       
   879   A b
       
   880     a
       
   881   A c
       
   882     a
       
   883   
       
   884   diff --git a/a b/a
       
   885   --- a/a
       
   886   +++ b/a
       
   887   @@ -1,1 +1,2 @@
       
   888    a
       
   889   +5
       
   890   diff --git a/a b/b
       
   891   copy from a
       
   892   copy to b
       
   893   --- a/a
       
   894   +++ b/b
       
   895   @@ -1,1 +1,2 @@
       
   896    a
       
   897   +5
       
   898   diff --git a/a b/c
       
   899   copy from a
       
   900   copy to c
       
   901   --- a/a
       
   902   +++ b/c
       
   903   @@ -1,1 +1,2 @@
       
   904    a
       
   905   +5
       
   906   
       
   907   - parent to root: --rev . --rev 0
       
   908   M a
       
   909   R b
       
   910   R c
       
   911   
       
   912   diff --git a/a b/a
       
   913   --- a/a
       
   914   +++ b/a
       
   915   @@ -1,2 +1,1 @@
       
   916    a
       
   917   -5
       
   918   diff --git a/b b/b
       
   919   deleted file mode 100644
       
   920   --- a/b
       
   921   +++ /dev/null
       
   922   @@ -1,2 +0,0 @@
       
   923   -a
       
   924   -5
       
   925   diff --git a/c b/c
       
   926   deleted file mode 100644
       
   927   --- a/c
       
   928   +++ /dev/null
       
   929   @@ -1,2 +0,0 @@
       
   930   -a
       
   931   -5
       
   932   
       
   933   - branch to parent: --rev 2 --rev .
       
   934   M a
       
   935   A b
       
   936     a
       
   937   A c
       
   938     a
       
   939   R x/y
       
   940   
       
   941   diff --git a/a b/a
       
   942   --- a/a
       
   943   +++ b/a
       
   944   @@ -1,3 +1,2 @@
       
   945    a
       
   946   -m1
       
   947   -m2
       
   948   +5
       
   949   diff --git a/a b/b
       
   950   copy from a
       
   951   copy to b
       
   952   --- a/a
       
   953   +++ b/b
       
   954   @@ -1,3 +1,2 @@
       
   955    a
       
   956   -m1
       
   957   -m2
       
   958   +5
       
   959   diff --git a/a b/c
       
   960   copy from a
       
   961   copy to c
       
   962   --- a/a
       
   963   +++ b/c
       
   964   @@ -1,3 +1,2 @@
       
   965    a
       
   966   -m1
       
   967   -m2
       
   968   +5
       
   969   diff --git a/x/y b/x/y
       
   970   deleted file mode 100644
       
   971   --- a/x/y
       
   972   +++ /dev/null
       
   973   @@ -1,1 +0,0 @@
       
   974   -y1
       
   975   
       
   976   - parent to branch: --rev . --rev 2
       
   977   M a
       
   978   A x/y
       
   979   R b
       
   980   R c
       
   981   
       
   982   diff --git a/a b/a
       
   983   --- a/a
       
   984   +++ b/a
       
   985   @@ -1,2 +1,3 @@
       
   986    a
       
   987   -5
       
   988   +m1
       
   989   +m2
       
   990   diff --git a/b b/b
       
   991   deleted file mode 100644
       
   992   --- a/b
       
   993   +++ /dev/null
       
   994   @@ -1,2 +0,0 @@
       
   995   -a
       
   996   -5
       
   997   diff --git a/c b/c
       
   998   deleted file mode 100644
       
   999   --- a/c
       
  1000   +++ /dev/null
       
  1001   @@ -1,2 +0,0 @@
       
  1002   -a
       
  1003   -5
       
  1004   diff --git a/x/y b/x/y
       
  1005   new file mode 100644
       
  1006   --- /dev/null
       
  1007   +++ b/x/y
       
  1008   @@ -0,0 +1,1 @@
       
  1009   +y1
       
  1010   
       
  1011   
       
  1012   $ tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
       
  1013   updating to branch default
       
  1014   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1015   created new head
       
  1016   ** circular rename **
       
  1017   ** add a a1 / hg mv a b / hg mv b a
       
  1018   - working to parent: 
       
  1019   A a
       
  1020     b
       
  1021   R b
       
  1022   
       
  1023   diff --git a/b b/a
       
  1024   rename from b
       
  1025   rename to a
       
  1026   
       
  1027   - working to root: --rev 0
       
  1028   M a
       
  1029   
       
  1030   diff --git a/a b/a
       
  1031   --- a/a
       
  1032   +++ b/a
       
  1033   @@ -1,1 +1,3 @@
       
  1034    a
       
  1035   +6
       
  1036   +a1
       
  1037   
       
  1038   - working to branch: --rev 2
       
  1039   M a
       
  1040   R x/y
       
  1041   
       
  1042   diff --git a/a b/a
       
  1043   --- a/a
       
  1044   +++ b/a
       
  1045   @@ -1,3 +1,3 @@
       
  1046    a
       
  1047   -m1
       
  1048   -m2
       
  1049   +6
       
  1050   +a1
       
  1051   diff --git a/x/y b/x/y
       
  1052   deleted file mode 100644
       
  1053   --- a/x/y
       
  1054   +++ /dev/null
       
  1055   @@ -1,1 +0,0 @@
       
  1056   -y1
       
  1057   
       
  1058   - root to parent: --rev 0 --rev .
       
  1059   A b
       
  1060     a
       
  1061   R a
       
  1062   
       
  1063   diff --git a/a b/b
       
  1064   rename from a
       
  1065   rename to b
       
  1066   --- a/a
       
  1067   +++ b/b
       
  1068   @@ -1,1 +1,3 @@
       
  1069    a
       
  1070   +6
       
  1071   +a1
       
  1072   
       
  1073   - parent to root: --rev . --rev 0
       
  1074   A a
       
  1075     b
       
  1076   R b
       
  1077   
       
  1078   diff --git a/b b/a
       
  1079   rename from b
       
  1080   rename to a
       
  1081   --- a/b
       
  1082   +++ b/a
       
  1083   @@ -1,3 +1,1 @@
       
  1084    a
       
  1085   -6
       
  1086   -a1
       
  1087   
       
  1088   - branch to parent: --rev 2 --rev .
       
  1089   A b
       
  1090     a
       
  1091   R a
       
  1092   R x/y
       
  1093   
       
  1094   diff --git a/a b/b
       
  1095   rename from a
       
  1096   rename to b
       
  1097   --- a/a
       
  1098   +++ b/b
       
  1099   @@ -1,3 +1,3 @@
       
  1100    a
       
  1101   -m1
       
  1102   -m2
       
  1103   +6
       
  1104   +a1
       
  1105   diff --git a/x/y b/x/y
       
  1106   deleted file mode 100644
       
  1107   --- a/x/y
       
  1108   +++ /dev/null
       
  1109   @@ -1,1 +0,0 @@
       
  1110   -y1
       
  1111   
       
  1112   - parent to branch: --rev . --rev 2
       
  1113   A a
       
  1114     b
       
  1115   A x/y
       
  1116   R b
       
  1117   
       
  1118   diff --git a/b b/a
       
  1119   rename from b
       
  1120   rename to a
       
  1121   --- a/b
       
  1122   +++ b/a
       
  1123   @@ -1,3 +1,3 @@
       
  1124    a
       
  1125   -6
       
  1126   -a1
       
  1127   +m1
       
  1128   +m2
       
  1129   diff --git a/x/y b/x/y
       
  1130   new file mode 100644
       
  1131   --- /dev/null
       
  1132   +++ b/x/y
       
  1133   @@ -0,0 +1,1 @@
       
  1134   +y1
       
  1135   
       
  1136   
       
  1137   $ tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
       
  1138   updating to branch default
       
  1139   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
  1140   created new head
       
  1141   moving x/x to y/x
       
  1142   ** directory move **
       
  1143   ** hg mv x y / add y/x x1 / add y/x x2
       
  1144   - working to parent: 
       
  1145   M y/x
       
  1146   
       
  1147   diff --git a/y/x b/y/x
       
  1148   --- a/y/x
       
  1149   +++ b/y/x
       
  1150   @@ -1,2 +1,3 @@
       
  1151    x
       
  1152    x1
       
  1153   +x2
       
  1154   
       
  1155   - working to root: --rev 0
       
  1156   M a
       
  1157   A y/x
       
  1158     x/x
       
  1159   R x/x
       
  1160   
       
  1161   diff --git a/a b/a
       
  1162   --- a/a
       
  1163   +++ b/a
       
  1164   @@ -1,1 +1,2 @@
       
  1165    a
       
  1166   +7
       
  1167   diff --git a/x/x b/y/x
       
  1168   rename from x/x
       
  1169   rename to y/x
       
  1170   --- a/x/x
       
  1171   +++ b/y/x
       
  1172   @@ -1,1 +1,3 @@
       
  1173    x
       
  1174   +x1
       
  1175   +x2
       
  1176   
       
  1177   - working to branch: --rev 2
       
  1178   M a
       
  1179   A y/x
       
  1180     x/x
       
  1181   R x/x
       
  1182   R x/y
       
  1183   
       
  1184   diff --git a/a b/a
       
  1185   --- a/a
       
  1186   +++ b/a
       
  1187   @@ -1,3 +1,2 @@
       
  1188    a
       
  1189   -m1
       
  1190   -m2
       
  1191   +7
       
  1192   diff --git a/x/y b/x/y
       
  1193   deleted file mode 100644
       
  1194   --- a/x/y
       
  1195   +++ /dev/null
       
  1196   @@ -1,1 +0,0 @@
       
  1197   -y1
       
  1198   diff --git a/x/x b/y/x
       
  1199   rename from x/x
       
  1200   rename to y/x
       
  1201   --- a/x/x
       
  1202   +++ b/y/x
       
  1203   @@ -1,1 +1,3 @@
       
  1204    x
       
  1205   +x1
       
  1206   +x2
       
  1207   
       
  1208   - root to parent: --rev 0 --rev .
       
  1209   M a
       
  1210   A y/x
       
  1211     x/x
       
  1212   R x/x
       
  1213   
       
  1214   diff --git a/a b/a
       
  1215   --- a/a
       
  1216   +++ b/a
       
  1217   @@ -1,1 +1,2 @@
       
  1218    a
       
  1219   +7
       
  1220   diff --git a/x/x b/y/x
       
  1221   rename from x/x
       
  1222   rename to y/x
       
  1223   --- a/x/x
       
  1224   +++ b/y/x
       
  1225   @@ -1,1 +1,2 @@
       
  1226    x
       
  1227   +x1
       
  1228   
       
  1229   - parent to root: --rev . --rev 0
       
  1230   M a
       
  1231   A x/x
       
  1232     y/x
       
  1233   R y/x
       
  1234   
       
  1235   diff --git a/a b/a
       
  1236   --- a/a
       
  1237   +++ b/a
       
  1238   @@ -1,2 +1,1 @@
       
  1239    a
       
  1240   -7
       
  1241   diff --git a/y/x b/x/x
       
  1242   rename from y/x
       
  1243   rename to x/x
       
  1244   --- a/y/x
       
  1245   +++ b/x/x
       
  1246   @@ -1,2 +1,1 @@
       
  1247    x
       
  1248   -x1
       
  1249   
       
  1250   - branch to parent: --rev 2 --rev .
       
  1251   M a
       
  1252   A y/x
       
  1253     x/x
       
  1254   R x/x
       
  1255   R x/y
       
  1256   
       
  1257   diff --git a/a b/a
       
  1258   --- a/a
       
  1259   +++ b/a
       
  1260   @@ -1,3 +1,2 @@
       
  1261    a
       
  1262   -m1
       
  1263   -m2
       
  1264   +7
       
  1265   diff --git a/x/y b/x/y
       
  1266   deleted file mode 100644
       
  1267   --- a/x/y
       
  1268   +++ /dev/null
       
  1269   @@ -1,1 +0,0 @@
       
  1270   -y1
       
  1271   diff --git a/x/x b/y/x
       
  1272   rename from x/x
       
  1273   rename to y/x
       
  1274   --- a/x/x
       
  1275   +++ b/y/x
       
  1276   @@ -1,1 +1,2 @@
       
  1277    x
       
  1278   +x1
       
  1279   
       
  1280   - parent to branch: --rev . --rev 2
       
  1281   M a
       
  1282   A x/x
       
  1283     y/x
       
  1284   A x/y
       
  1285   R y/x
       
  1286   
       
  1287   diff --git a/a b/a
       
  1288   --- a/a
       
  1289   +++ b/a
       
  1290   @@ -1,2 +1,3 @@
       
  1291    a
       
  1292   -7
       
  1293   +m1
       
  1294   +m2
       
  1295   diff --git a/y/x b/x/x
       
  1296   rename from y/x
       
  1297   rename to x/x
       
  1298   --- a/y/x
       
  1299   +++ b/x/x
       
  1300   @@ -1,2 +1,1 @@
       
  1301    x
       
  1302   -x1
       
  1303   diff --git a/x/y b/x/y
       
  1304   new file mode 100644
       
  1305   --- /dev/null
       
  1306   +++ b/x/y
       
  1307   @@ -0,0 +1,1 @@
       
  1308   +y1
       
  1309   
       
  1310   
       
  1311 
       
  1312 Cannot implement unrelated branch with tb
       
  1313 testing copies with unrelated branch
       
  1314 
       
  1315   $ hg init unrelated
       
  1316   $ cd unrelated
       
  1317   $ add a a
       
  1318   $ hg ci -Am adda
       
  1319   adding a
       
  1320   $ hg mv a b
       
  1321   $ hg ci -m movea
       
  1322   $ hg up -C null
       
  1323   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
  1324   $ add a a
       
  1325   $ hg ci -Am addunrelateda
       
  1326   adding a
       
  1327   created new head
       
  1328 
       
  1329 unrelated branch diff
       
  1330 
       
  1331   $ hg diff --git -r 2 -r 1
       
  1332   diff --git a/a b/a
       
  1333   deleted file mode 100644
       
  1334   --- a/a
       
  1335   +++ /dev/null
       
  1336   @@ -1,1 +0,0 @@
       
  1337   -a
       
  1338   diff --git a/b b/b
       
  1339   new file mode 100644
       
  1340   --- /dev/null
       
  1341   +++ b/b
       
  1342   @@ -0,0 +1,1 @@
       
  1343   +a
       
  1344   $ cd ..