tests/test-narrow-rebase.t
changeset 36117 a2a6e724d61a
child 40337 cb516a854bc7
equal deleted inserted replaced
36116:7f68235f23ff 36117:a2a6e724d61a
       
     1 
       
     2   $ . "$TESTDIR/narrow-library.sh"
       
     3 
       
     4 create full repo
       
     5 
       
     6   $ hg init master
       
     7   $ cd master
       
     8 
       
     9   $ mkdir inside
       
    10   $ echo inside1 > inside/f1
       
    11   $ echo inside2 > inside/f2
       
    12   $ mkdir outside
       
    13   $ echo outside1 > outside/f1
       
    14   $ echo outside2 > outside/f2
       
    15   $ hg ci -Aqm 'initial'
       
    16 
       
    17   $ echo modified > inside/f1
       
    18   $ hg ci -qm 'modify inside/f1'
       
    19 
       
    20   $ hg update -q 0
       
    21   $ echo modified2 > inside/f2
       
    22   $ hg ci -qm 'modify inside/f2'
       
    23 
       
    24   $ hg update -q 0
       
    25   $ echo modified > outside/f1
       
    26   $ hg ci -qm 'modify outside/f1'
       
    27 
       
    28   $ hg update -q 0
       
    29   $ echo modified2 > outside/f1
       
    30   $ hg ci -qm 'conflicting outside/f1'
       
    31 
       
    32   $ cd ..
       
    33 
       
    34   $ hg clone --narrow ssh://user@dummy/master narrow --include inside
       
    35   requesting all changes
       
    36   adding changesets
       
    37   adding manifests
       
    38   adding file changes
       
    39   added 5 changesets with 4 changes to 2 files (+3 heads)
       
    40   new changesets *:* (glob)
       
    41   updating to branch default
       
    42   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    43   $ cd narrow
       
    44   $ cat >> $HGRCPATH <<EOF
       
    45   > [extensions]
       
    46   > rebase=
       
    47   > EOF
       
    48 
       
    49   $ hg update -q 0
       
    50 
       
    51 Can rebase onto commit where no files outside narrow spec are involved
       
    52 
       
    53   $ hg update -q 0
       
    54   $ echo modified > inside/f2
       
    55   $ hg ci -qm 'modify inside/f2'
       
    56   $ hg rebase -d 'desc("modify inside/f1")'
       
    57   rebasing 5:c2f36d04e05d "modify inside/f2" (tip)
       
    58   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
       
    59 
       
    60 Can rebase onto conflicting changes inside narrow spec
       
    61 
       
    62   $ hg update -q 0
       
    63   $ echo conflicting > inside/f1
       
    64   $ hg ci -qm 'conflicting inside/f1'
       
    65   $ hg rebase -d 'desc("modify inside/f1")' 2>&1 | egrep -v '(warning:|incomplete!)'
       
    66   rebasing 6:cdce97fbf653 "conflicting inside/f1" (tip)
       
    67   merging inside/f1
       
    68   unresolved conflicts (see hg resolve, then hg rebase --continue)
       
    69   $ echo modified3 > inside/f1
       
    70   $ hg resolve -m 2>&1 | grep -v continue:
       
    71   (no more unresolved files)
       
    72   $ hg rebase --continue
       
    73   rebasing 6:cdce97fbf653 "conflicting inside/f1" (tip)
       
    74   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
       
    75 
       
    76 Can rebase onto non-conflicting changes outside narrow spec
       
    77 
       
    78   $ hg update -q 0
       
    79   $ echo modified > inside/f2
       
    80   $ hg ci -qm 'modify inside/f2'
       
    81   $ hg rebase -d 'desc("modify outside/f1")'
       
    82   rebasing 7:c2f36d04e05d "modify inside/f2" (tip)
       
    83   saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-rebase.hg (glob)
       
    84 
       
    85 Rebase interrupts on conflicting changes outside narrow spec
       
    86 
       
    87   $ hg update -q 'desc("conflicting outside/f1")'
       
    88   $ hg phase -f -d .
       
    89   no phases changed
       
    90   $ hg rebase -d 'desc("modify outside/f1")'
       
    91   rebasing 4:707c035aadb6 "conflicting outside/f1"
       
    92   abort: conflict in file 'outside/f1' is outside narrow clone
       
    93   [255]