tests/test-impexp-branch.t
changeset 14126 fbbe9239574a
parent 12119 46ab8c5dd99a
child 15615 41885892796e
equal deleted inserted replaced
14125:2852843947da 14126:fbbe9239574a
     9   >         sys.exit(1)
     9   >         sys.exit(1)
    10   >     if hmatch.group(1) == 'Branch':
    10   >     if hmatch.group(1) == 'Branch':
    11   >         sys.exit(0)
    11   >         sys.exit(0)
    12   > sys.exit(1)
    12   > sys.exit(1)
    13   > EOF
    13   > EOF
       
    14 
    14   $ hg init a
    15   $ hg init a
    15   $ cd a
    16   $ cd a
    16   $ echo "Rev 1" >rev
    17   $ echo "Rev 1" >rev
    17   $ hg add rev
    18   $ hg add rev
    18   $ hg commit -m "No branch."
    19   $ hg commit -m "No branch."
    19   $ hg branch abranch
    20   $ hg branch abranch
    20   marked working directory as branch abranch
    21   marked working directory as branch abranch
    21   $ echo "Rev  2" >rev
    22   $ echo "Rev  2" >rev
    22   $ hg commit -m "With branch."
    23   $ hg commit -m "With branch."
    23   $ if hg export 0 | python ../findbranch.py; then
    24 
       
    25   $ hg export 0 > ../r0.patch
       
    26   $ hg export 1 > ../r1.patch
       
    27   $ cd ..
       
    28 
       
    29   $ if python findbranch.py < r0.patch; then
    24   >     echo "Export of default branch revision has Branch header" 1>&2
    30   >     echo "Export of default branch revision has Branch header" 1>&2
    25   >     exit 1
    31   >     exit 1
    26   > fi
    32   > fi
    27   $ if hg export 1 | python ../findbranch.py; then
    33 
       
    34   $ if python findbranch.py < r1.patch; then
    28   >     :  # Do nothing
    35   >     :  # Do nothing
    29   > else
    36   > else
    30   >     echo "Export of branch revision is missing Branch header" 1>&2
    37   >     echo "Export of branch revision is missing Branch header" 1>&2
    31   >     exit 1
    38   >     exit 1
    32   > fi
    39   > fi
    33 
    40 
    34 Make sure import still works with branch information in patches.
    41 Make sure import still works with branch information in patches.
    35 
    42 
    36   $ cd ..
       
    37   $ hg init b
    43   $ hg init b
    38   $ cd b
    44   $ cd b
    39   $ hg -R ../a export 0 | hg import -
    45   $ hg import ../r0.patch
    40   applying patch from stdin
    46   applying ../r0.patch
    41   $ hg -R ../a export 1 | hg import -
    47   $ hg import ../r1.patch
    42   applying patch from stdin
    48   applying ../r1.patch
    43   $ cd ..
    49   $ cd ..
    44   $ rm -rf b
    50 
    45   $ hg init b
    51   $ hg init c
    46   $ cd b
    52   $ cd c
    47   $ hg -R ../a export 0 | hg import --exact -
    53   $ hg import --exact ../r0.patch
    48   applying patch from stdin
    54   applying ../r0.patch
    49   $ hg -R ../a export 1 | hg import --exact -
    55   $ hg import --exact ../r1.patch
    50   applying patch from stdin
    56   applying ../r1.patch