tests/test-pick.t
branchmercurial-4.7
changeset 4771 ac079483153a
parent 4512 7a779a288793
parent 4687 313565dd75e3
child 4866 2a500c5e293b
equal deleted inserted replaced
4672:653c42af172e 4771:ac079483153a
     1 Test for the pick command
     1 Test for the pick command
     2 
     2 
     3   $ cat >> $HGRCPATH <<EOF
     3   $ cat >> $HGRCPATH <<EOF
     4   > [alias]
     4   > [alias]
     5   > glog = log -G -T "{rev}:{node|short} {desc}\n"
     5   > glog = log -G -T "{rev}:{node|short} {desc}\n"
       
     6   > glf = log -GT "{rev}: {desc} ({files})\n"
     6   > [extensions]
     7   > [extensions]
     7   > EOF
     8   > EOF
     8   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
     9   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
     9 
    10 
    10   $ mkcommit() {
    11   $ mkcommit() {
   384   o  5f07cbf7d111: default
   385   o  5f07cbf7d111: default
   385   |
   386   |
   386   o  d03a6bcc83cd: default
   387   o  d03a6bcc83cd: default
   387   
   388   
   388   $ cd ..
   389   $ cd ..
       
   390 
       
   391 Check that pick doesn't drop files after conflicts occur (issue6037)
       
   392 --------------------------------------------------------------------
       
   393 
       
   394   $ hg init issue6037
       
   395   $ cd issue6037
       
   396 
       
   397   $ echo apple > a
       
   398   $ hg ci -qAm 'apple'
       
   399 
       
   400   $ echo apricot > a
       
   401   $ echo banana > b
       
   402   $ hg ci -qAm 'apricot and banana'
       
   403 
       
   404   $ echo avocado > a
       
   405   $ hg ci -m 'avocado'
       
   406 
       
   407   $ hg glf
       
   408   @  2: avocado (a)
       
   409   |
       
   410   o  1: apricot and banana (a b)
       
   411   |
       
   412   o  0: apple (a)
       
   413   
       
   414 Now let's change order of 1 and 2 using pick command
       
   415 
       
   416   $ hg up -r 0
       
   417   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   418 
       
   419 We avoid merge conflict here just to make the test shorter
       
   420 
       
   421   $ hg pick -r 2 --tool :other
       
   422   picking 2:f08a1e4a33c4 "avocado"
       
   423 
       
   424 Now we pick revision 1 that touches two files (a and b), merge conflict is expected
       
   425 
       
   426   $ hg pick -r 1
       
   427   picking 1:892e123ebf62 "apricot and banana"
       
   428   merging a
       
   429   warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
       
   430   unresolved merge conflicts (see hg help resolve)
       
   431   [1]
       
   432   $ hg resolve -t :other a
       
   433   (no more unresolved files)
       
   434   continue: hg pick --continue
       
   435   $ hg pick --continue
       
   436 
       
   437 Demonstrate that b was not forgotten and is definitely included in 4
       
   438 
       
   439   $ hg status b -A
       
   440   C b
       
   441   $ hg glf
       
   442   @  4: apricot and banana (a b)
       
   443   |
       
   444   o  3: avocado (a)
       
   445   |
       
   446   o  0: apple (a)
       
   447   
       
   448   $ cd ..