tests/test-convert-darcs.t
changeset 12524 8773cac3a455
parent 12407 5bfab61c2fee
child 12718 372abc799caa
equal deleted inserted replaced
12523:a164a9cff771 12524:8773cac3a455
       
     1 
       
     2   $ "$TESTDIR/hghave" darcs || exit 80
       
     3   $ echo "[extensions]" >> $HGRCPATH
       
     4   $ echo "convert=" >> $HGRCPATH
       
     5   $ echo 'graphlog =' >> $HGRCPATH
       
     6   $ DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
       
     7   $ HOME=`pwd`/do_not_use_HOME_darcs; export HOME
       
     8 
       
     9 skip if we can't import elementtree
       
    10 
       
    11   $ mkdir dummy
       
    12   $ mkdir dummy/_darcs
       
    13   $ if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
       
    14   >     echo 'skipped: missing feature: elementtree module'
       
    15   >     exit 80
       
    16   > fi
       
    17 
       
    18 try converting darcs1 repository
       
    19 
       
    20   $ hg clone -q "$TESTDIR/darcs1.hg" darcs
       
    21   $ hg convert -s darcs darcs/darcs1 2>&1 | grep darcs-1.0
       
    22   darcs-1.0 repository format is unsupported, please upgrade
       
    23 
       
    24 initialize darcs repo
       
    25 
       
    26   $ mkdir darcs-repo
       
    27   $ cd darcs-repo
       
    28   $ darcs init
       
    29   $ echo a > a
       
    30   $ darcs record -a -l -m p0
       
    31   Finished recording patch 'p0'
       
    32   $ cd ..
       
    33 
       
    34 branch and update
       
    35 
       
    36   $ darcs get darcs-repo darcs-clone >/dev/null
       
    37   $ cd darcs-clone
       
    38   $ echo c >> a
       
    39   $ echo c > c
       
    40   $ darcs record -a -l -m p1.1
       
    41   Finished recording patch 'p1.1'
       
    42   $ cd ..
       
    43 
       
    44 update source
       
    45 
       
    46   $ cd darcs-repo
       
    47   $ echo b >> a
       
    48   $ echo b > b
       
    49   $ darcs record -a -l -m p1.2
       
    50   Finished recording patch 'p1.2'
       
    51 
       
    52 merge branch
       
    53 
       
    54   $ darcs pull -a ../darcs-clone
       
    55   Backing up ./a(-darcs-backup0)
       
    56   We have conflicts in the following files:
       
    57   ./a
       
    58   Finished pulling and applying.
       
    59   $ sleep 1
       
    60   $ echo e > a
       
    61   $ echo f > f
       
    62   $ mkdir dir
       
    63   $ echo d > dir/d
       
    64   $ echo d > dir/d2
       
    65   $ darcs record -a -l -m p2
       
    66   Finished recording patch 'p2'
       
    67 
       
    68 test file and directory move
       
    69 
       
    70   $ darcs mv f ff
       
    71 
       
    72 Test remove + move
       
    73 
       
    74   $ darcs remove dir/d2
       
    75   $ rm dir/d2
       
    76   $ darcs mv dir dir2
       
    77   $ darcs record -a -l -m p3
       
    78   Finished recording patch 'p3'
       
    79 
       
    80 test utf-8 commit message and author
       
    81 
       
    82   $ echo g > g
       
    83 
       
    84 darcs is encoding agnostic, so it takes whatever bytes it's given
       
    85 
       
    86   $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
       
    87   Finished recording patch 'p4: desc ñ'
       
    88   $ glog()
       
    89   > {
       
    90   >     HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
       
    91   > }
       
    92   $ cd ..
       
    93   $ hg convert darcs-repo darcs-repo-hg
       
    94   initializing destination darcs-repo-hg repository
       
    95   scanning source...
       
    96   sorting...
       
    97   converting...
       
    98   5 p0
       
    99   4 p1.2
       
   100   3 p1.1
       
   101   2 p2
       
   102   1 p3
       
   103   0 p4: desc ?
       
   104 
       
   105 The converter does not currently handle patch conflicts very well.
       
   106 When they occur, it reverts *all* changes and moves forward,
       
   107 letting the conflict resolving patch fix collisions.
       
   108 Unfortunately, non-conflicting changes, like the addition of the
       
   109 "c" file in p1.1 patch are reverted too.
       
   110 Just to say that manifest not listing "c" here is a bug.
       
   111 
       
   112   $ glog -R darcs-repo-hg
       
   113   o  5 "p4: desc ñ" (author ñ) files: g
       
   114   |
       
   115   o  4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
       
   116   |
       
   117   o  3 "p2" (test@example.org) files: a dir/d dir/d2 f
       
   118   |
       
   119   o  2 "p1.1" (test@example.org) files:
       
   120   |
       
   121   o  1 "p1.2" (test@example.org) files: a b
       
   122   |
       
   123   o  0 "p0" (test@example.org) files: a
       
   124   
       
   125   $ hg up -q -R darcs-repo-hg
       
   126   $ hg -R darcs-repo-hg manifest --debug
       
   127   7225b30cdf38257d5cc7780772c051b6f33e6d6b 644   a
       
   128   1e88685f5ddec574a34c70af492f95b6debc8741 644   b
       
   129   37406831adc447ec2385014019599dfec953c806 644   dir2/d
       
   130   b783a337463792a5c7d548ad85a7d3253c16ba8c 644   ff
       
   131   0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644   g