tests/test-split.t
branchstable
changeset 3269 e6b980687311
parent 3060 f43a310c4338
child 3270 e6150b9b88d9
equal deleted inserted replaced
3233:bd01eb0108f4 3269:e6b980687311
   484   date:        Thu Jan 01 00:00:00 1970 +0000
   484   date:        Thu Jan 01 00:00:00 1970 +0000
   485   summary:     split8
   485   summary:     split8
   486   
   486   
   487   $ hg topic
   487   $ hg topic
   488    * mytopic (2 changesets)
   488    * mytopic (2 changesets)
       
   489 
       
   490 Test split the first commit on a branch
       
   491 
       
   492   $ touch SPLIT1 SPLIT2
       
   493   $ hg add SPLIT1 SPLIT2
       
   494   $ hg branch another-branch
       
   495   marked working directory as branch another-branch
       
   496   $ hg commit -m "To be splitted"
       
   497   $ hg log -G -l 3
       
   498   @  changeset:   21:8dad923bdb9b
       
   499   |  branch:      another-branch
       
   500   |  tag:         tip
       
   501   |  topic:       mytopic
       
   502   |  user:        test
       
   503   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   504   |  summary:     To be splitted
       
   505   |
       
   506   o  changeset:   20:2532b288af61
       
   507   |  branch:      new-branch
       
   508   |  topic:       mytopic
       
   509   |  user:        test
       
   510   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   511   |  summary:     split8
       
   512   |
       
   513   o  changeset:   19:addcf498f19e
       
   514   |  branch:      new-branch
       
   515   ~  topic:       mytopic
       
   516      parent:      17:fdb403258632
       
   517      user:        test
       
   518      date:        Thu Jan 01 00:00:00 1970 +0000
       
   519      summary:     split7
       
   520   
       
   521   $ hg export .
       
   522   # HG changeset patch
       
   523   # User test
       
   524   # Date 0 0
       
   525   #      Thu Jan 01 00:00:00 1970 +0000
       
   526   # Branch another-branch
       
   527   # Node ID 8dad923bdb9bb3b99291caa5baeb03bbc30dfd33
       
   528   # Parent  2532b288af61bd19239a95ae2a3ecb9b0ad4b8e1
       
   529   # EXP-Topic mytopic
       
   530   To be splitted
       
   531   
       
   532   diff --git a/SPLIT1 b/SPLIT1
       
   533   new file mode 100644
       
   534   diff --git a/SPLIT2 b/SPLIT2
       
   535   new file mode 100644
       
   536 
       
   537   $ hg split -r . << EOF
       
   538   > Y
       
   539   > N
       
   540   > N
       
   541   > Y
       
   542   > EOF
       
   543   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   544   adding SPLIT1
       
   545   adding SPLIT2
       
   546   diff --git a/SPLIT1 b/SPLIT1
       
   547   new file mode 100644
       
   548   examine changes to 'SPLIT1'? [Ynesfdaq?] Y
       
   549   
       
   550   diff --git a/SPLIT2 b/SPLIT2
       
   551   new file mode 100644
       
   552   examine changes to 'SPLIT2'? [Ynesfdaq?] N
       
   553   
       
   554   Done splitting? [yN] N
       
   555   diff --git a/SPLIT2 b/SPLIT2
       
   556   new file mode 100644
       
   557   examine changes to 'SPLIT2'? [Ynesfdaq?] Y
       
   558   
       
   559   no more change to split
       
   560 
       
   561 The splitted changesets should be on the 'another-branch'
       
   562   $ hg log -G -l 3
       
   563   @  changeset:   23:4e2e9dee1bcc
       
   564   |  branch:      new-branch
       
   565   |  tag:         tip
       
   566   |  topic:       mytopic
       
   567   |  user:        test
       
   568   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   569   |  summary:     split10
       
   570   |
       
   571   o  changeset:   22:8c18390f1ccc
       
   572   |  branch:      new-branch
       
   573   |  topic:       mytopic
       
   574   |  parent:      20:2532b288af61
       
   575   |  user:        test
       
   576   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   577   |  summary:     split9
       
   578   |
       
   579   o  changeset:   20:2532b288af61
       
   580   |  branch:      new-branch
       
   581   ~  topic:       mytopic
       
   582      user:        test
       
   583      date:        Thu Jan 01 00:00:00 1970 +0000
       
   584      summary:     split8
       
   585   
       
   586 
       
   587 Try splitting the first changeset of a branch then cancel
       
   588 
       
   589   $ hg branch yet-another-branch
       
   590   marked working directory as branch yet-another-branch
       
   591   $ touch SPLIT3 SPLIT4
       
   592   $ hg add SPLIT3 SPLIT4
       
   593   $ hg commit -m "To be splitted again"
       
   594 
       
   595   $ hg up "tip~1"
       
   596   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
   597 
       
   598   $ hg log -G -l 2
       
   599   o  changeset:   24:0207fa6107a1
       
   600   |  branch:      yet-another-branch
       
   601   |  tag:         tip
       
   602   |  topic:       mytopic
       
   603   |  user:        test
       
   604   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   605   |  summary:     To be splitted again
       
   606   |
       
   607   @  changeset:   23:4e2e9dee1bcc
       
   608   |  branch:      new-branch
       
   609   ~  topic:       mytopic
       
   610      user:        test
       
   611      date:        Thu Jan 01 00:00:00 1970 +0000
       
   612      summary:     split10
       
   613   
       
   614   $ hg branch
       
   615   new-branch
       
   616 
       
   617   $ hg split -r tip << EOF
       
   618   > Y
       
   619   > q
       
   620   > EOF
       
   621   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   622   adding SPLIT3
       
   623   adding SPLIT4
       
   624   diff --git a/SPLIT3 b/SPLIT3
       
   625   new file mode 100644
       
   626   examine changes to 'SPLIT3'? [Ynesfdaq?] Y
       
   627   
       
   628   diff --git a/SPLIT4 b/SPLIT4
       
   629   new file mode 100644
       
   630   examine changes to 'SPLIT4'? [Ynesfdaq?] q
       
   631   
       
   632   abort: user quit
       
   633   [255]
       
   634 
       
   635   $ hg branch
       
   636   new-branch
       
   637 
       
   638   $ hg log -G -l 2
       
   639   o  changeset:   24:0207fa6107a1
       
   640   |  branch:      yet-another-branch
       
   641   |  tag:         tip
       
   642   |  topic:       mytopic
       
   643   |  user:        test
       
   644   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   645   |  summary:     To be splitted again
       
   646   |
       
   647   @  changeset:   23:4e2e9dee1bcc
       
   648   |  branch:      new-branch
       
   649   ~  topic:       mytopic
       
   650      user:        test
       
   651      date:        Thu Jan 01 00:00:00 1970 +0000
       
   652      summary:     split10
       
   653