tests/test-casecollision-merge.t
branchstable
changeset 15673 d550168f11ce
child 16478 cbf2ea2f5ca1
equal deleted inserted replaced
15672:2ebe3d0ce91d 15673:d550168f11ce
       
     1 run only on case-insensitive filesystems
       
     2 
       
     3   $ "$TESTDIR/hghave" icasefs || exit 80
       
     4 
       
     5 ################################
       
     6 test for branch merging
       
     7 ################################
       
     8 
       
     9   $ hg init repo1
       
    10   $ cd repo1
       
    11 
       
    12 create base revision
       
    13 
       
    14   $ echo base > base.txt
       
    15   $ hg add base.txt
       
    16   $ hg commit -m 'base'
       
    17 
       
    18 add same file in different case on both heads
       
    19 
       
    20   $ echo a > a.txt
       
    21   $ hg add a.txt
       
    22   $ hg commit -m 'add a.txt'
       
    23 
       
    24   $ hg update 0
       
    25   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    26 
       
    27   $ echo A > A.TXT
       
    28   $ hg add A.TXT
       
    29   $ hg commit -m 'add A.TXT'
       
    30   created new head
       
    31 
       
    32 merge another, and fail with case-folding collision
       
    33 
       
    34   $ hg merge
       
    35   abort: case-folding collision between a.txt and A.TXT
       
    36   [255]
       
    37 
       
    38 check clean-ness of working directory
       
    39 
       
    40   $ hg status
       
    41   $ hg parents --template '{rev}\n'
       
    42   2
       
    43   $ cd ..
       
    44 
       
    45 ################################
       
    46 test for linear updates
       
    47 ################################
       
    48 
       
    49   $ hg init repo2
       
    50   $ cd repo2
       
    51 
       
    52 create base revision (rev:0)
       
    53 
       
    54   $ hg import --bypass --exact - <<EOF
       
    55   > # HG changeset patch
       
    56   > # User null
       
    57   > # Date 1 0
       
    58   > # Node ID e1bdf414b0ea9c831fd3a14e94a0a18e1410f98b
       
    59   > # Parent  0000000000000000000000000000000000000000
       
    60   > add a
       
    61   > 
       
    62   > diff --git a/a b/a
       
    63   > new file mode 100644
       
    64   > --- /dev/null
       
    65   > +++ b/a
       
    66   > @@ -0,0 +1,3 @@
       
    67   > +this is line 1
       
    68   > +this is line 2
       
    69   > +this is line 3
       
    70   > EOF
       
    71   applying patch from stdin
       
    72 
       
    73 create rename revision (rev:1)
       
    74 
       
    75   $ hg import --bypass --exact - <<EOF
       
    76   > # HG changeset patch
       
    77   > # User null
       
    78   > # Date 1 0
       
    79   > # Node ID 9dca9f19bb91851bc693544b598b0740629edfad
       
    80   > # Parent  e1bdf414b0ea9c831fd3a14e94a0a18e1410f98b
       
    81   > rename a to A
       
    82   > 
       
    83   > diff --git a/a b/A
       
    84   > rename from a
       
    85   > rename to A
       
    86   > EOF
       
    87   applying patch from stdin
       
    88 
       
    89 update to base revision, and modify 'a'
       
    90 
       
    91   $ hg update 0
       
    92   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    93   $ echo 'this is added line' >> a
       
    94 
       
    95 update to current tip linearly
       
    96 
       
    97   $ hg update 1
       
    98   merging a and A to A
       
    99   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
       
   100 
       
   101 check status and contents of file
       
   102 
       
   103   $ hg status -A
       
   104   M A
       
   105   $ cat A
       
   106   this is line 1
       
   107   this is line 2
       
   108   this is line 3
       
   109   this is added line