tests/test-drop.t
changeset 790 5af309865040
child 812 60dd0c401034
equal deleted inserted replaced
789:0d2bb0282e78 790:5af309865040
       
     1 
       
     2   $ cat >> $HGRCPATH <<EOF
       
     3   > [extensions]
       
     4   > hgext.rebase=
       
     5   > hgext.graphlog=
       
     6   > EOF
       
     7   $ echo "drophack=$(echo $(dirname $TESTDIR))/hgext/drophack.py" >> $HGRCPATH
       
     8   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
       
     9   $ mkcommit() {
       
    10   >    echo "$1" > "$1"
       
    11   >    hg add "$1"
       
    12   >    hg ci -m "add $1"
       
    13   > }
       
    14   $ summary() {
       
    15   > echo ============ graph ==============
       
    16   > hg log -G
       
    17   > echo ============ hidden =============
       
    18   > hg log --hidden -G
       
    19   > echo ============ obsmark ============
       
    20   > hg debugobsolete
       
    21   > }
       
    22 
       
    23 
       
    24   $ hg init repo
       
    25   $ cd repo
       
    26   $ mkcommit base
       
    27 
       
    28 drop a single changeset without any rewrite
       
    29 ================================================
       
    30 
       
    31 
       
    32   $ mkcommit simple-single
       
    33   $ summary
       
    34   ============ graph ==============
       
    35   @  changeset:   1:d4e7845543ff
       
    36   |  tag:         tip
       
    37   |  user:        test
       
    38   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
    39   |  summary:     add simple-single
       
    40   |
       
    41   o  changeset:   0:b4952fcf48cf
       
    42      user:        test
       
    43      date:        Thu Jan 01 00:00:00 1970 +0000
       
    44      summary:     add base
       
    45   
       
    46   ============ hidden =============
       
    47   @  changeset:   1:d4e7845543ff
       
    48   |  tag:         tip
       
    49   |  user:        test
       
    50   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
    51   |  summary:     add simple-single
       
    52   |
       
    53   o  changeset:   0:b4952fcf48cf
       
    54      user:        test
       
    55      date:        Thu Jan 01 00:00:00 1970 +0000
       
    56      summary:     add base
       
    57   
       
    58   ============ obsmark ============
       
    59   $ hg drop .
       
    60   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    61   working directory now at b4952fcf48cf
       
    62   search obsmarker: wall * comb * user * sys * (glob)
       
    63   0 obsmarkers found
       
    64   search nodes: wall * comb * user * sys * (glob)
       
    65   1 nodes found
       
    66   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d4e7845543ff-drophack.hg
       
    67   strip nodes: wall * comb * user * sys * (glob)
       
    68   $ summary
       
    69   ============ graph ==============
       
    70   @  changeset:   0:b4952fcf48cf
       
    71      tag:         tip
       
    72      user:        test
       
    73      date:        Thu Jan 01 00:00:00 1970 +0000
       
    74      summary:     add base
       
    75   
       
    76   ============ hidden =============
       
    77   @  changeset:   0:b4952fcf48cf
       
    78      tag:         tip
       
    79      user:        test
       
    80      date:        Thu Jan 01 00:00:00 1970 +0000
       
    81      summary:     add base
       
    82   
       
    83   ============ obsmark ============
       
    84 
       
    85 Try to drop a changeset with children
       
    86 ================================================
       
    87 
       
    88   $ mkcommit parent
       
    89   $ mkcommit child
       
    90   $ summary
       
    91   ============ graph ==============
       
    92   @  changeset:   2:34b6c051bf1f
       
    93   |  tag:         tip
       
    94   |  user:        test
       
    95   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
    96   |  summary:     add child
       
    97   |
       
    98   o  changeset:   1:19509a42b0d0
       
    99   |  user:        test
       
   100   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   101   |  summary:     add parent
       
   102   |
       
   103   o  changeset:   0:b4952fcf48cf
       
   104      user:        test
       
   105      date:        Thu Jan 01 00:00:00 1970 +0000
       
   106      summary:     add base
       
   107   
       
   108   ============ hidden =============
       
   109   @  changeset:   2:34b6c051bf1f
       
   110   |  tag:         tip
       
   111   |  user:        test
       
   112   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   113   |  summary:     add child
       
   114   |
       
   115   o  changeset:   1:19509a42b0d0
       
   116   |  user:        test
       
   117   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   118   |  summary:     add parent
       
   119   |
       
   120   o  changeset:   0:b4952fcf48cf
       
   121      user:        test
       
   122      date:        Thu Jan 01 00:00:00 1970 +0000
       
   123      summary:     add base
       
   124   
       
   125   ============ obsmark ============
       
   126   $ hg drop 1
       
   127   cannot drop revision with children (no-eol)
       
   128   [1]
       
   129   $ summary
       
   130   ============ graph ==============
       
   131   @  changeset:   2:34b6c051bf1f
       
   132   |  tag:         tip
       
   133   |  user:        test
       
   134   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   135   |  summary:     add child
       
   136   |
       
   137   o  changeset:   1:19509a42b0d0
       
   138   |  user:        test
       
   139   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   140   |  summary:     add parent
       
   141   |
       
   142   o  changeset:   0:b4952fcf48cf
       
   143      user:        test
       
   144      date:        Thu Jan 01 00:00:00 1970 +0000
       
   145      summary:     add base
       
   146   
       
   147   ============ hidden =============
       
   148   @  changeset:   2:34b6c051bf1f
       
   149   |  tag:         tip
       
   150   |  user:        test
       
   151   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   152   |  summary:     add child
       
   153   |
       
   154   o  changeset:   1:19509a42b0d0
       
   155   |  user:        test
       
   156   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   157   |  summary:     add parent
       
   158   |
       
   159   o  changeset:   0:b4952fcf48cf
       
   160      user:        test
       
   161      date:        Thu Jan 01 00:00:00 1970 +0000
       
   162      summary:     add base
       
   163   
       
   164   ============ obsmark ============
       
   165 
       
   166 Try to drop a public changeset
       
   167 ================================================
       
   168 
       
   169   $ hg phase --public 2
       
   170   $ hg drop 2
       
   171   cannot drop public revision (no-eol)
       
   172   [1]
       
   173 
       
   174 
       
   175 Try to drop a changeset with rewrite
       
   176 ================================================
       
   177 
       
   178   $ hg phase --force --draft 2
       
   179   $ echo babar >> child
       
   180   $ hg commit --amend
       
   181   $ summary
       
   182   ============ graph ==============
       
   183   @  changeset:   4:a2c06c884bfe
       
   184   |  tag:         tip
       
   185   |  parent:      1:19509a42b0d0
       
   186   |  user:        test
       
   187   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   188   |  summary:     add child
       
   189   |
       
   190   o  changeset:   1:19509a42b0d0
       
   191   |  user:        test
       
   192   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   193   |  summary:     add parent
       
   194   |
       
   195   o  changeset:   0:b4952fcf48cf
       
   196      user:        test
       
   197      date:        Thu Jan 01 00:00:00 1970 +0000
       
   198      summary:     add base
       
   199   
       
   200   ============ hidden =============
       
   201   @  changeset:   4:a2c06c884bfe
       
   202   |  tag:         tip
       
   203   |  parent:      1:19509a42b0d0
       
   204   |  user:        test
       
   205   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   206   |  summary:     add child
       
   207   |
       
   208   | x  changeset:   3:87ea30a976fd
       
   209   | |  user:        test
       
   210   | |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   211   | |  summary:     temporary amend commit for 34b6c051bf1f
       
   212   | |
       
   213   | x  changeset:   2:34b6c051bf1f
       
   214   |/   user:        test
       
   215   |    date:        Thu Jan 01 00:00:00 1970 +0000
       
   216   |    summary:     add child
       
   217   |
       
   218   o  changeset:   1:19509a42b0d0
       
   219   |  user:        test
       
   220   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   221   |  summary:     add parent
       
   222   |
       
   223   o  changeset:   0:b4952fcf48cf
       
   224      user:        test
       
   225      date:        Thu Jan 01 00:00:00 1970 +0000
       
   226      summary:     add base
       
   227   
       
   228   ============ obsmark ============
       
   229   34b6c051bf1f78db6aef400776de5cb964470207 a2c06c884bfe53d3840026248bd8a7eafa152df8 0 {'date': '* *', 'user': 'test'} (glob)
       
   230   87ea30a976fdf235bf096f04899cb02a903873e2 0 {'date': '* *', 'user': 'test'} (glob)
       
   231   $ hg drop .
       
   232   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
   233   working directory now at 19509a42b0d0
       
   234   search obsmarker: wall * comb * user * sys * (glob)
       
   235   1 obsmarkers found
       
   236   search nodes: wall * comb * user * sys * (glob)
       
   237   2 nodes found
       
   238   strip obsmarker: wall * comb * user * sys * (glob)
       
   239   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a2c06c884bfe-drophack.hg (glob)
       
   240   strip nodes: wall * comb * user * sys * (glob)
       
   241   $ summary
       
   242   ============ graph ==============
       
   243   @  changeset:   1:19509a42b0d0
       
   244   |  tag:         tip
       
   245   |  user:        test
       
   246   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   247   |  summary:     add parent
       
   248   |
       
   249   o  changeset:   0:b4952fcf48cf
       
   250      user:        test
       
   251      date:        Thu Jan 01 00:00:00 1970 +0000
       
   252      summary:     add base
       
   253   
       
   254   ============ hidden =============
       
   255   @  changeset:   1:19509a42b0d0
       
   256   |  tag:         tip
       
   257   |  user:        test
       
   258   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
   259   |  summary:     add parent
       
   260   |
       
   261   o  changeset:   0:b4952fcf48cf
       
   262      user:        test
       
   263      date:        Thu Jan 01 00:00:00 1970 +0000
       
   264      summary:     add base
       
   265   
       
   266   ============ obsmark ============
       
   267   87ea30a976fdf235bf096f04899cb02a903873e2 0 {'date': '* *', 'user': 'test'} (glob)