tests/test-histedit-commute.t
changeset 41509 11c076786d56
parent 39480 89630d0b3e23
child 45857 ec6ba70be853
equal deleted inserted replaced
41508:b0865b5919c6 41509:11c076786d56
    50      user:        test
    50      user:        test
    51      date:        Thu Jan 01 00:00:00 1970 +0000
    51      date:        Thu Jan 01 00:00:00 1970 +0000
    52      summary:     a
    52      summary:     a
    53   
    53   
    54 
    54 
       
    55 
    55 show the edit commands offered
    56 show the edit commands offered
    56   $ HGEDITOR=cat hg histedit 177f92b77385
    57   $ HGEDITOR=cat hg histedit 177f92b77385
    57   pick 177f92b77385 2 c
    58   pick 177f92b77385 2 c
    58   pick 055a42cdd887 3 d
    59   pick 055a42cdd887 3 d
    59   pick e860deea161a 4 e
    60   pick e860deea161a 4 e
    74   #  d, drop = remove commit from history
    75   #  d, drop = remove commit from history
    75   #  f, fold = use commit, but combine it with the one above
    76   #  f, fold = use commit, but combine it with the one above
    76   #  r, roll = like fold, but discard this commit's description and date
    77   #  r, roll = like fold, but discard this commit's description and date
    77   #
    78   #
    78 
    79 
       
    80 
       
    81 test customization of revision summary
       
    82   $ HGEDITOR=cat hg histedit 177f92b77385 \
       
    83   >  --config histedit.summary-template='I am rev {rev} desc {desc} tags {tags}'
       
    84   pick 177f92b77385 I am rev 2 desc c tags 
       
    85   pick 055a42cdd887 I am rev 3 desc d tags 
       
    86   pick e860deea161a I am rev 4 desc e tags 
       
    87   pick 652413bf663e I am rev 5 desc f tags tip
       
    88   
       
    89   # Edit history between 177f92b77385 and 652413bf663e
       
    90   #
       
    91   # Commits are listed from least to most recent
       
    92   #
       
    93   # You can reorder changesets by reordering the lines
       
    94   #
       
    95   # Commands:
       
    96   #
       
    97   #  e, edit = use commit, but stop for amending
       
    98   #  m, mess = edit commit message without changing commit content
       
    99   #  p, pick = use commit
       
   100   #  b, base = checkout changeset and apply further changesets from there
       
   101   #  d, drop = remove commit from history
       
   102   #  f, fold = use commit, but combine it with the one above
       
   103   #  r, roll = like fold, but discard this commit's description and date
       
   104   #
       
   105 
       
   106 
    79 edit the history
   107 edit the history
    80 (use a hacky editor to check histedit-last-edit.txt backup)
   108 (use a hacky editor to check histedit-last-edit.txt backup)
    81 
   109 
    82   $ EDITED="$TESTTMP/editedhistory"
   110   $ EDITED="$TESTTMP/editedhistory"
    83   $ cat > $EDITED <<EOF
   111   $ cat > $EDITED <<EOF
   140      user:        test
   168      user:        test
   141      date:        Thu Jan 01 00:00:00 1970 +0000
   169      date:        Thu Jan 01 00:00:00 1970 +0000
   142      summary:     a
   170      summary:     a
   143   
   171   
   144 
   172 
       
   173 
   145 put things back
   174 put things back
   146 
   175 
   147   $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
   176   $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
   148   > pick 177f92b77385 c
   177   > pick 177f92b77385 c
   149   > pick 07114f51870f d
   178   > pick 07114f51870f d
   182      user:        test
   211      user:        test
   183      date:        Thu Jan 01 00:00:00 1970 +0000
   212      date:        Thu Jan 01 00:00:00 1970 +0000
   184      summary:     a
   213      summary:     a
   185   
   214   
   186 
   215 
       
   216 
   187 slightly different this time
   217 slightly different this time
   188 
   218 
   189   $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
   219   $ hg histedit 177f92b77385 --commands - << EOF 2>&1 | fixbundle
   190   > pick 10517e47bbbb d
   220   > pick 10517e47bbbb d
   191   > pick 7eca9b5b1148 f
   221   > pick 7eca9b5b1148 f
   222   o  changeset:   0:cb9a9f314b8b
   252   o  changeset:   0:cb9a9f314b8b
   223      user:        test
   253      user:        test
   224      date:        Thu Jan 01 00:00:00 1970 +0000
   254      date:        Thu Jan 01 00:00:00 1970 +0000
   225      summary:     a
   255      summary:     a
   226   
   256   
       
   257 
   227 
   258 
   228 keep prevents stripping dead revs
   259 keep prevents stripping dead revs
   229   $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
   260   $ hg histedit 799205341b6b --keep --commands - 2>&1 << EOF | fixbundle
   230   > pick 799205341b6b d
   261   > pick 799205341b6b d
   231   > pick be9ae3a309c6 f
   262   > pick be9ae3a309c6 f
   274      user:        test
   305      user:        test
   275      date:        Thu Jan 01 00:00:00 1970 +0000
   306      date:        Thu Jan 01 00:00:00 1970 +0000
   276      summary:     a
   307      summary:     a
   277   
   308   
   278 
   309 
       
   310 
   279 try with --rev
   311 try with --rev
   280   $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
   312   $ hg histedit --commands - --rev -2 2>&1 <<EOF | fixbundle
   281   > pick de71b079d9ce e
   313   > pick de71b079d9ce e
   282   > pick 38b92f448761 c
   314   > pick 38b92f448761 c
   283   > EOF
   315   > EOF
   324   o  changeset:   0:cb9a9f314b8b
   356   o  changeset:   0:cb9a9f314b8b
   325      user:        test
   357      user:        test
   326      date:        Thu Jan 01 00:00:00 1970 +0000
   358      date:        Thu Jan 01 00:00:00 1970 +0000
   327      summary:     a
   359      summary:     a
   328   
   360   
       
   361 
   329 Verify that revsetalias entries work with histedit:
   362 Verify that revsetalias entries work with histedit:
   330   $ cat >> $HGRCPATH <<EOF
   363   $ cat >> $HGRCPATH <<EOF
   331   > [revsetalias]
   364   > [revsetalias]
   332   > grandparent(ARG) = p1(p1(ARG))
   365   > grandparent(ARG) = p1(p1(ARG))
   333   > EOF
   366   > EOF
   352   #  b, base = checkout changeset and apply further changesets from there
   385   #  b, base = checkout changeset and apply further changesets from there
   353   #  d, drop = remove commit from history
   386   #  d, drop = remove commit from history
   354   #  f, fold = use commit, but combine it with the one above
   387   #  f, fold = use commit, but combine it with the one above
   355   #  r, roll = like fold, but discard this commit's description and date
   388   #  r, roll = like fold, but discard this commit's description and date
   356   #
   389   #
       
   390 
   357 
   391 
   358 should also work if a commit message is missing
   392 should also work if a commit message is missing
   359   $ BUNDLE="$TESTDIR/missing-comment.hg"
   393   $ BUNDLE="$TESTDIR/missing-comment.hg"
   360   $ hg init missing
   394   $ hg init missing
   361   $ cd missing
   395   $ cd missing
   382   o  changeset:   0:141947992243
   416   o  changeset:   0:141947992243
   383      user:        Robert Altman <robert.altman@telventDTN.com>
   417      user:        Robert Altman <robert.altman@telventDTN.com>
   384      date:        Mon Nov 28 16:35:28 2011 +0000
   418      date:        Mon Nov 28 16:35:28 2011 +0000
   385      summary:     Checked in text file
   419      summary:     Checked in text file
   386   
   420   
       
   421 
   387   $ hg histedit 0
   422   $ hg histedit 0
   388   $ cd ..
   423   $ cd ..
   389 
   424 
   390   $ cd ..
   425   $ cd ..
   391 
   426 
   438   --- /dev/null
   473   --- /dev/null
   439   +++ b/another-dir/initial-file
   474   +++ b/another-dir/initial-file
   440   @@ -0,0 +1,1 @@
   475   @@ -0,0 +1,1 @@
   441   +changed
   476   +changed
   442 
   477 
       
   478 
   443   $ hg --config diff.git=yes export 1
   479   $ hg --config diff.git=yes export 1
   444   # HG changeset patch
   480   # HG changeset patch
   445   # User test
   481   # User test
   446   # Date 0 0
   482   # Date 0 0
   447   #      Thu Jan 01 00:00:00 1970 +0000
   483   #      Thu Jan 01 00:00:00 1970 +0000
   450   renamed
   486   renamed
   451   
   487   
   452   diff --git a/another-dir/initial-file b/another-dir/renamed-file
   488   diff --git a/another-dir/initial-file b/another-dir/renamed-file
   453   rename from another-dir/initial-file
   489   rename from another-dir/initial-file
   454   rename to another-dir/renamed-file
   490   rename to another-dir/renamed-file
       
   491 
   455 
   492 
   456   $ cd ..
   493   $ cd ..
   457 
   494 
   458 Test that branches are preserved and stays active
   495 Test that branches are preserved and stays active
   459 -------------------------------------------------
   496 -------------------------------------------------