Differences between revisions 12 and 13
Revision 12 as of 2012-10-25 19:36:14
Size: 1813
Editor: mpm
Comment:
Revision 13 as of 2012-11-11 12:46:35
Size: 0
Editor: abuehl
Comment: executing proposed deletion
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<<Include(A:delete)>>
<<Include(A:style)>>

= Strip =

Command provided by the MqExtension

`hg strip rev` removes the `rev` revision and all its descendants from a repository. To remove an unwanted branch, you would specify the first revision specific to that branch. By default, `hg strip` will place a backup in the `.hg/strip-backup/` directory. If strip turned out to be a bad idea, you can restore with `hg unbundle .hg/strip-backup/filename`.

If other revisions in the repository have higher numbers than the stripped one, they are renumbered in order to keep a sequential numbering scheme. The hash remains the same.

== Example ==

The following repository containing multiple branches and non sequentials numbers

{{{#!dot
digraph G {
 compound=true;
 rankdir = LR
 background="#999999";

 a -> b -> c -> e;
 a -> d -> f;
 b -> f;

 a [label = "0\n0xac4a"];
 b [label = "1\n0xefe8"];
 c [label = "2\n0x8e29"];
 d [label = "3\n0x0087"];
 e [label = "4\n0x3a32"];
 f [label = "5\n0xad2e"];

}
}}}

A strip on that repository on the revision 2:8e29 will also strip the revision 4:3a32, as this one is a descendant of the revision 2.

Furthermore, stripping revision two will renumber the revision 3 and 5 in order to end up with a repository containing only sequential revision numbers.

{{{#!dot
digraph G {
 compound=true;
 rankdir = LR
 background="#999999";

 a -> b -> f;
 a -> d -> f;

 a [label = "0\n0xac4a"];
 b [label = "1\n0xefe8"];
 d [label = "2\n0x0087"];
 f [label = "3\n0xad2e"];

 subgraph cluster_0 {
  style=filled;
  color=lightgrey;
  node [style=filled,color=white];

  c -> e;

 c [label = "0x8e29"];
 e [label = "0x3a32"];

  label="created bundle";
 }

}
}}}
----
CategoryCommand

[[FrenchStrip|Français]]