tests/test-absorb.t
author Martin von Zweigbergk <martinvonz@google.com>
Thu, 22 Oct 2020 22:29:22 -0700
changeset 45769 b4c193509cd0
parent 45712 0a330055340c
child 45878 f4a218331ff4
permissions -rw-r--r--
rebase: use hard-coded template for one-line commit description This is to prepare for making making the one-line summary customizable. The template ended up pretty complicated because of the conditional output of "(<bookmarks etc>)". Maybe we can simplify the template later. Differential Revision: https://phab.mercurial-scm.org/D9250
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH << EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
  > [extensions]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
  > absorb=
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     6
  $ sedi() { # workaround check-code
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
  > pattern="$1"
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
  > shift
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
  > for i in "$@"; do
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
  >     sed "$pattern" "$i" > "$i".tmp
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
  >     mv "$i".tmp "$i"
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
  > done
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
  > }
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
  $ hg init repo1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
  $ cd repo1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    18
Do not crash with empty repo:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
  $ hg absorb
39453
ab452995eaff absorb: clarify the reason for not finding changesets to modify
Matt Harbison <matt_harbison@yahoo.com>
parents: 39188
diff changeset
    21
  abort: no mutable changeset to change
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
  [255]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    23
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    24
Make some commits:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
  $ for i in 1 2 3 4 5; do
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
  >   echo $i >> a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
  >   hg commit -A a -m "commit $i" -q
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
  > done
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    31
  $ hg annotate a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    32
  0: 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    33
  1: 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    34
  2: 3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    35
  3: 4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    36
  4: 5
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    37
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    38
Change a few lines:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    39
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    40
  $ cat > a <<EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    41
  > 1a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    42
  > 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    43
  > 3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    44
  > 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    45
  > 5e
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    46
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    47
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    48
Preview absorb changes:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    49
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    50
  $ hg absorb --print-changes --dry-run
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    51
  showing changes for a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    52
          @@ -0,2 +0,2 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    53
  4ec16f8 -1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    54
  5c5f952 -2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    55
  4ec16f8 +1a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    56
  5c5f952 +2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    57
          @@ -3,2 +3,2 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    58
  ad8b8b7 -4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    59
  4f55fa6 -5
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    60
  ad8b8b7 +4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    61
  4f55fa6 +5e
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    62
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    63
  4 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    64
  4f55fa6 commit 5
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    65
  ad8b8b7 commit 4
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    66
  5c5f952 commit 2
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
    67
  4ec16f8 commit 1
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    68
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    69
Run absorb:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    71
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    72
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    73
  2 of 2 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    74
  $ hg annotate a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    75
  0: 1a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    76
  1: 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    77
  2: 3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    78
  3: 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    79
  4: 5e
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    80
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    81
Delete a few lines and related commits will be removed if they will be empty:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    82
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    83
  $ cat > a <<EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    84
  > 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    85
  > 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
    86
  > EOF
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    87
  $ echo y | hg absorb --config ui.interactive=1
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    88
  showing changes for a
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    89
          @@ -0,1 +0,0 @@
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    90
  f548282 -1a
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    91
          @@ -2,1 +1,0 @@
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    92
  ff5d556 -3
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    93
          @@ -4,1 +2,0 @@
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    94
  84e5416 -5e
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    95
  
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    96
  3 changesets affected
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    97
  84e5416 commit 5
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    98
  ff5d556 commit 3
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
    99
  f548282 commit 1
44991
65d19d9c8e76 absorb: make it clear what happens when no input
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 44985
diff changeset
   100
  apply changes (y/N)?  y
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   101
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   102
  3 of 3 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   103
  $ hg annotate a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   104
  1: 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   105
  2: 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   106
  $ hg log -T '{rev} {desc}\n' -Gp
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   107
  @  2 commit 4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   108
  |  diff -r 1cae118c7ed8 -r 58a62bade1c6 a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   109
  |  --- a/a	Thu Jan 01 00:00:00 1970 +0000
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   110
  |  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   111
  |  @@ -1,1 +1,2 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   112
  |   2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   113
  |  +4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   114
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   115
  o  1 commit 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   116
  |  diff -r 84add69aeac0 -r 1cae118c7ed8 a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   117
  |  --- a/a	Thu Jan 01 00:00:00 1970 +0000
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   118
  |  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   119
  |  @@ -0,0 +1,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   120
  |  +2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   121
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   122
  o  0 commit 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   123
  
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   124
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   125
Non 1:1 map changes will be ignored:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   126
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   127
  $ echo 1 > a
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   128
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   129
  nothing applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   130
  [1]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   131
40951
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   132
The prompt is not given if there are no changes to be applied, even if there
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   133
are some changes that won't be applied:
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   134
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   135
  $ hg absorb
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   136
  showing changes for a
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   137
          @@ -0,2 +0,1 @@
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   138
          -2b
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   139
          -4d
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   140
          +1
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   141
  
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   142
  0 changesets affected
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   143
  nothing applied
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   144
  [1]
e993a86cfcb8 absorb: don't prompt to apply changes when there are none to apply
Danny Hooper <hooper@google.com>
parents: 40190
diff changeset
   145
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   146
Insertaions:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   147
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   148
  $ cat > a << EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   149
  > insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   150
  > 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   151
  > 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   152
  > insert aftert 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   153
  > EOF
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   154
  $ hg absorb -q --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   155
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   156
  $ hg annotate a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   157
  1: insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   158
  1: 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   159
  2: 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   160
  2: insert aftert 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   161
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   162
Bookmarks are moved:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   163
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   164
  $ hg bookmark -r 1 b1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   165
  $ hg bookmark -r 2 b2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   166
  $ hg bookmark ba
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   167
  $ hg bookmarks
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   168
     b1                        1:b35060a57a50
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   169
     b2                        2:946e4bc87915
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   170
   * ba                        2:946e4bc87915
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   171
  $ sedi 's/insert/INSERT/' a
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   172
  $ hg absorb -q --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   173
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   174
  $ hg bookmarks
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   175
     b1                        1:a4183e9b3d31
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   176
     b2                        2:c9b20c925790
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   177
   * ba                        2:c9b20c925790
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   178
42266
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   179
Non-modified files are ignored:
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   180
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   181
  $ touch b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   182
  $ hg commit -A b -m b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   183
  $ touch c
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   184
  $ hg add c
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   185
  $ hg rm b
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   186
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   187
  nothing applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   188
  [1]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   189
  $ sedi 's/INSERT/Insert/' a
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   190
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   191
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   192
  2 of 2 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   193
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   194
  A c
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   195
  R b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   196
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   197
Public commits will not be changed:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   198
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   199
  $ hg phase -p 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   200
  $ sedi 's/Insert/insert/' a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   201
  $ hg absorb -pn
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   202
  showing changes for a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   203
          @@ -0,1 +0,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   204
          -Insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   205
          +insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   206
          @@ -3,1 +3,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   207
  85b4e0e -Insert aftert 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   208
  85b4e0e +insert aftert 4d
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   209
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   210
  1 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   211
  85b4e0e commit 4
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   212
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   213
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   214
  1 of 2 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   215
  $ hg diff -U 0
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   216
  diff -r 1c8eadede62a a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   217
  --- a/a	Thu Jan 01 00:00:00 1970 +0000
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   218
  +++ b/a	* (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   219
  @@ -1,1 +1,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   220
  -Insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   221
  +insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   222
  $ hg annotate a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   223
  1: Insert before 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   224
  1: 2b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   225
  2: 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   226
  2: insert aftert 4d
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   227
42266
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   228
  $ hg co -qC 1
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   229
  $ sedi 's/Insert/insert/' a
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   230
  $ hg absorb --apply-changes
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   231
  abort: no mutable changeset to change
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   232
  [255]
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   233
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   234
Make working copy clean:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   235
42266
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   236
  $ hg co -qC ba
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   237
  $ rm c
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   238
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   239
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   240
Merge commit will not be changed:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   241
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   242
  $ echo 1 > m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   243
  $ hg commit -A m1 -m m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   244
  $ hg bookmark -q -i m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   245
  $ hg update -q '.^'
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   246
  $ echo 2 > m2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   247
  $ hg commit -q -A m2 -m m2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   248
  $ hg merge -q m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   249
  $ hg commit -m merge
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   250
  $ hg bookmark -d m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   251
  $ hg log -G -T '{rev} {desc} {phase}\n'
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   252
  @    6 merge draft
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   253
  |\
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   254
  | o  5 m2 draft
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   255
  | |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   256
  o |  4 m1 draft
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   257
  |/
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   258
  o  3 b draft
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   259
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   260
  o  2 commit 4 draft
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   261
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   262
  o  1 commit 2 public
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   263
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   264
  o  0 commit 1 public
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   265
  
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   266
  $ echo 2 >> m1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   267
  $ echo 2 >> m2
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   268
  $ hg absorb --apply-changes
42266
b3fc78c028ef absorb: be more specific when erroring out on merge commit
Martin von Zweigbergk <martinvonz@google.com>
parents: 40951
diff changeset
   269
  abort: cannot absorb into a merge
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   270
  [255]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   271
  $ hg revert -q -C m1 m2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   272
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   273
Use a new repo:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   274
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   275
  $ cd ..
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   276
  $ hg init repo2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   277
  $ cd repo2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   278
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   279
Make some commits to multiple files:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   280
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   281
  $ for f in a b; do
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   282
  >   for i in 1 2; do
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   283
  >     echo $f line $i >> $f
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   284
  >     hg commit -A $f -m "commit $f $i" -q
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   285
  >   done
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   286
  > done
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   287
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   288
Use pattern to select files to be fixed up:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   289
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   290
  $ sedi 's/line/Line/' a b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   291
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   292
  M a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   293
  M b
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   294
  $ hg absorb --apply-changes a
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   295
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   296
  1 of 1 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   297
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   298
  M b
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   299
  $ hg absorb --apply-changes --exclude b
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   300
  nothing applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   301
  [1]
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   302
  $ hg absorb --apply-changes b
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   303
  saved backup bundle to * (glob)
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   304
  1 of 1 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   305
  $ hg status
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   306
  $ cat a b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   307
  a Line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   308
  a Line 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   309
  b Line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   310
  b Line 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   311
38961
19344143b3e1 absorb: following UI conventions
David Demelier <markand@malikania.fr>
parents: 38932
diff changeset
   312
Test config option absorb.max-stack-size:
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   313
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   314
  $ sedi 's/Line/line/' a b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   315
  $ hg log -T '{rev}:{node} {desc}\n'
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   316
  3:712d16a8f445834e36145408eabc1d29df05ec09 commit b 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   317
  2:74cfa6294160149d60adbf7582b99ce37a4597ec commit b 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   318
  1:28f10dcf96158f84985358a2e5d5b3505ca69c22 commit a 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   319
  0:f9a81da8dc53380ed91902e5b82c1b36255a4bd0 commit a 1
38961
19344143b3e1 absorb: following UI conventions
David Demelier <markand@malikania.fr>
parents: 38932
diff changeset
   320
  $ hg --config absorb.max-stack-size=1 absorb -pn
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   321
  absorb: only the recent 1 changesets will be analysed
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   322
  showing changes for a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   323
          @@ -0,2 +0,2 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   324
          -a Line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   325
          -a Line 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   326
          +a line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   327
          +a line 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   328
  showing changes for b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   329
          @@ -0,2 +0,2 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   330
          -b Line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   331
  712d16a -b Line 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   332
          +b line 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   333
  712d16a +b line 2
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   334
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   335
  1 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   336
  712d16a commit b 2
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   337
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   338
Test obsolete markers creation:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   339
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   340
  $ cat >> $HGRCPATH << EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   341
  > [experimental]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   342
  > evolution=createmarkers
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   343
  > [absorb]
38961
19344143b3e1 absorb: following UI conventions
David Demelier <markand@malikania.fr>
parents: 38932
diff changeset
   344
  > add-noise=1
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   345
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   346
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   347
  $ hg --config absorb.max-stack-size=3 absorb -a
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   348
  absorb: only the recent 3 changesets will be analysed
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   349
  2 of 2 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   350
  $ hg log -T '{rev}:{node|short} {desc} {get(extras, "absorb_source")}\n'
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   351
  6:3dfde4199b46 commit b 2 712d16a8f445834e36145408eabc1d29df05ec09
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   352
  5:99cfab7da5ff commit b 1 74cfa6294160149d60adbf7582b99ce37a4597ec
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   353
  4:fec2b3bd9e08 commit a 2 28f10dcf96158f84985358a2e5d5b3505ca69c22
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   354
  0:f9a81da8dc53 commit a 1 
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   355
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   356
  1 of 1 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   357
  $ hg log -T '{rev}:{node|short} {desc} {get(extras, "absorb_source")}\n'
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   358
  10:e1c8c1e030a4 commit b 2 3dfde4199b4610ea6e3c6fa9f5bdad8939d69524
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   359
  9:816c30955758 commit b 1 99cfab7da5ffdaf3b9fc6643b14333e194d87f46
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   360
  8:5867d584106b commit a 2 fec2b3bd9e0834b7cb6a564348a0058171aed811
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   361
  7:8c76602baf10 commit a 1 f9a81da8dc53380ed91902e5b82c1b36255a4bd0
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   362
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   363
Executable files:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   364
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   365
  $ cat >> $HGRCPATH << EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   366
  > [diff]
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   367
  > git=True
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   368
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   369
  $ cd ..
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   370
  $ hg init repo3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   371
  $ cd repo3
39188
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   372
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   373
#if execbit
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   374
  $ echo > foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   375
  $ chmod +x foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   376
  $ hg add foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   377
  $ hg commit -mfoo
39188
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   378
#else
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   379
  $ hg import -q --bypass - <<EOF
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   380
  > # HG changeset patch
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   381
  > foo
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   382
  > 
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   383
  > diff --git a/foo.py b/foo.py
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   384
  > new file mode 100755
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   385
  > --- /dev/null
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   386
  > +++ b/foo.py
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   387
  > @@ -0,0 +1,1 @@
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   388
  > +
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   389
  > EOF
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   390
  $ hg up -q
3fa9058f4f79 test-absorb: stabilize for no-execbit platforms
Matt Harbison <matt_harbison@yahoo.com>
parents: 38961
diff changeset
   391
#endif
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   392
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   393
  $ echo bla > foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   394
  $ hg absorb --dry-run --print-changes
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   395
  showing changes for foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   396
          @@ -0,1 +0,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   397
  99b4ae7 -
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   398
  99b4ae7 +bla
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   399
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   400
  1 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   401
  99b4ae7 foo
42351
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   402
  $ hg absorb --dry-run --interactive --print-changes
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   403
  diff -r 99b4ae712f84 foo.py
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   404
  1 hunks, 1 lines changed
42566
f802a75da585 patch: use a short, fixed-size message for last line of prompt (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42351
diff changeset
   405
  examine changes to 'foo.py'?
f802a75da585 patch: use a short, fixed-size message for last line of prompt (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42351
diff changeset
   406
  (enter ? for help) [Ynesfdaq?] y
42351
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   407
  
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   408
  @@ -1,1 +1,1 @@
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   409
  -
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   410
  +bla
42566
f802a75da585 patch: use a short, fixed-size message for last line of prompt (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42351
diff changeset
   411
  record this change to 'foo.py'?
f802a75da585 patch: use a short, fixed-size message for last line of prompt (issue6158)
Kyle Lippincott <spectral@google.com>
parents: 42351
diff changeset
   412
  (enter ? for help) [Ynesfdaq?] y
42351
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   413
  
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   414
  showing changes for foo.py
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   415
          @@ -0,1 +0,1 @@
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   416
  99b4ae7 -
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   417
  99b4ae7 +bla
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   418
  
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   419
  1 changesets affected
86f17fc31aa8 absorb: fix interactive mode I didn't know existed
Augie Fackler <augie@google.com>
parents: 42266
diff changeset
   420
  99b4ae7 foo
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   421
  $ hg absorb --apply-changes
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   422
  1 of 1 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   423
  $ hg diff -c .
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   424
  diff --git a/foo.py b/foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   425
  new file mode 100755
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   426
  --- /dev/null
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   427
  +++ b/foo.py
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   428
  @@ -0,0 +1,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   429
  +bla
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   430
  $ hg diff
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   431
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   432
Remove lines may delete changesets:
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   433
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   434
  $ cd ..
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   435
  $ hg init repo4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   436
  $ cd repo4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   437
  $ cat > a <<EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   438
  > 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   439
  > 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   440
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   441
  $ hg commit -m a12 -A a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   442
  $ cat > b <<EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   443
  > 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   444
  > 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   445
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   446
  $ hg commit -m b12 -A b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   447
  $ echo 3 >> b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   448
  $ hg commit -m b3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   449
  $ echo 4 >> b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   450
  $ hg commit -m b4
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   451
  $ echo 1 > b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   452
  $ echo 3 >> a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   453
  $ hg absorb -pn
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   454
  showing changes for a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   455
          @@ -2,0 +2,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   456
  bfafb49 +3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   457
  showing changes for b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   458
          @@ -1,3 +1,0 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   459
  1154859 -2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   460
  30970db -3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   461
  a393a58 -4
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   462
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   463
  4 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   464
  a393a58 b4
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   465
  30970db b3
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   466
  1154859 b12
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   467
  bfafb49 a12
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   468
  $ hg absorb -av | grep became
40150
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   469
  0:bfafb49242db: 1 file(s) changed, became 4:1a2de97fc652
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   470
  1:115485984805: 2 file(s) changed, became 5:0c930dfab74c
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   471
  2:30970dbf7b40: became empty and was dropped
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   472
  3:a393a58b9a85: became empty and was dropped
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   473
  $ hg log -T '{rev} {desc}\n' -Gp
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   474
  @  5 b12
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   475
  |  diff --git a/b b/b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   476
  |  new file mode 100644
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   477
  |  --- /dev/null
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   478
  |  +++ b/b
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   479
  |  @@ -0,0 +1,1 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   480
  |  +1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   481
  |
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   482
  o  4 a12
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   483
     diff --git a/a b/a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   484
     new file mode 100644
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   485
     --- /dev/null
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   486
     +++ b/a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   487
     @@ -0,0 +1,3 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   488
     +1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   489
     +2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   490
     +3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   491
  
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   492
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   493
Setting config rewrite.empty-successor=keep causes empty changesets to get committed:
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   494
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   495
  $ cd ..
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   496
  $ hg init repo4a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   497
  $ cd repo4a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   498
  $ cat > a <<EOF
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   499
  > 1
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   500
  > 2
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   501
  > EOF
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   502
  $ hg commit -m a12 -A a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   503
  $ cat > b <<EOF
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   504
  > 1
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   505
  > 2
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   506
  > EOF
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   507
  $ hg commit -m b12 -A b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   508
  $ echo 3 >> b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   509
  $ hg commit -m b3
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   510
  $ echo 4 >> b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   511
  $ hg commit -m b4
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   512
  $ hg commit -m empty --config ui.allowemptycommit=True
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   513
  $ echo 1 > b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   514
  $ echo 3 >> a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   515
  $ hg absorb -pn
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   516
  showing changes for a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   517
          @@ -2,0 +2,1 @@
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   518
  bfafb49 +3
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   519
  showing changes for b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   520
          @@ -1,3 +1,0 @@
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   521
  1154859 -2
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   522
  30970db -3
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   523
  a393a58 -4
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   524
  
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   525
  4 changesets affected
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   526
  a393a58 b4
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   527
  30970db b3
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   528
  1154859 b12
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   529
  bfafb49 a12
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   530
  $ hg absorb -av --config rewrite.empty-successor=keep | grep became
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   531
  0:bfafb49242db: 1 file(s) changed, became 5:1a2de97fc652
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   532
  1:115485984805: 2 file(s) changed, became 6:0c930dfab74c
45170
c87bd1fe3da2 absorb: improve message for the case when changeset became empty
Manuel Jacob <me@manueljacob.de>
parents: 45125
diff changeset
   533
  2:30970dbf7b40: 2 file(s) changed, became empty as 7:df6574ae635c
c87bd1fe3da2 absorb: improve message for the case when changeset became empty
Manuel Jacob <me@manueljacob.de>
parents: 45125
diff changeset
   534
  3:a393a58b9a85: 2 file(s) changed, became empty as 8:ad4bd3462c9e
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   535
  4:1bb0e8cff87a: 2 file(s) changed, became 9:2dbed75af996
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   536
  $ hg log -T '{rev} {desc}\n' -Gp
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   537
  @  9 empty
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   538
  |
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   539
  o  8 b4
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   540
  |
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   541
  o  7 b3
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   542
  |
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   543
  o  6 b12
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   544
  |  diff --git a/b b/b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   545
  |  new file mode 100644
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   546
  |  --- /dev/null
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   547
  |  +++ b/b
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   548
  |  @@ -0,0 +1,1 @@
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   549
  |  +1
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   550
  |
45125
f55099982bc5 absorb: make it explicit if empty changeset was created
Manuel Jacob <me@manueljacob.de>
parents: 45124
diff changeset
   551
  o  5 a12
45124
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   552
     diff --git a/a b/a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   553
     new file mode 100644
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   554
     --- /dev/null
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   555
     +++ b/a
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   556
     @@ -0,0 +1,3 @@
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   557
     +1
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   558
     +2
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   559
     +3
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   560
  
3ee8e2d5c0d8 absorb: consider rewrite.empty-successor configuration
Manuel Jacob <me@manueljacob.de>
parents: 44991
diff changeset
   561
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   562
Use revert to make the current change and its parent disappear.
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   563
This should move us to the non-obsolete ancestor.
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   564
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   565
  $ cd ..
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   566
  $ hg init repo5
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   567
  $ cd repo5
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   568
  $ cat > a <<EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   569
  > 1
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   570
  > 2
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   571
  > EOF
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   572
  $ hg commit -m a12 -A a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   573
  $ hg id
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   574
  bfafb49242db tip
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   575
  $ echo 3 >> a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   576
  $ hg commit -m a123 a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   577
  $ echo 4 >> a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   578
  $ hg commit -m a1234 a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   579
  $ hg id
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   580
  82dbe7fd19f0 tip
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   581
  $ hg revert -r 0 a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   582
  $ hg absorb -pn
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   583
  showing changes for a
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   584
          @@ -2,2 +2,0 @@
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   585
  f1c23dd -3
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   586
  82dbe7f -4
40188
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   587
  
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   588
  2 changesets affected
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   589
  82dbe7f a1234
2c5316796f45 absorb: print summary of changesets affected
Mark Thomas <mbthomas@fb.com>
parents: 40150
diff changeset
   590
  f1c23dd a123
40190
31dfa7dac4c9 absorb: prompt user to accept absorb changes by default
Mark Thomas <mbthomas@fb.com>
parents: 40188
diff changeset
   591
  $ hg absorb --apply-changes --verbose
40150
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   592
  1:f1c23dd5d08d: became empty and was dropped
1be1689d9ce9 absorb: print '{rev}:' as a prefix to the hash
Matt Harbison <matt_harbison@yahoo.com>
parents: 39453
diff changeset
   593
  2:82dbe7fd19f0: became empty and was dropped
38917
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   594
  a: 1 of 1 chunk(s) applied
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   595
  $ hg id
5111d11b8719 absorb: import extension from Facebook's hg-experimental
Augie Fackler <augie@google.com>
parents:
diff changeset
   596
  bfafb49242db tip
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   597
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   598
  $ cd ..
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   599
  $ hg init repo6
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   600
  $ cd repo6
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   601
  $ echo a1 > a
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   602
  $ touch b
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   603
  $ hg commit -m a -A a b
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   604
  $ hg branch foo -q
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   605
  $ echo b > b
45712
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   606
  $ hg commit -m 'foo (child of 0cde1ae39321)'  # will become empty
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   607
  $ hg branch bar -q
45712
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   608
  $ hg commit -m 'bar (child of e969dc86aefc)'  # is already empty
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   609
  $ echo a2 > a
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   610
  $ printf '' > b
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   611
  $ hg absorb --apply-changes --verbose | grep became
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   612
  0:0cde1ae39321: 1 file(s) changed, became 3:fc7fcdd90fdb
45712
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   613
  1:e969dc86aefc: 2 file(s) changed, became 4:8fc6b2cb43a5
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   614
  2:0298954ced32: 2 file(s) changed, became 5:ca8386dc4e2c
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   615
  $ hg log -T '{rev}:{node|short} (branch: {branch}) {desc}\n' -G --stat
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   616
  @  5:ca8386dc4e2c (branch: bar) bar (child of 8fc6b2cb43a5)
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   617
  |
45712
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   618
  o  4:8fc6b2cb43a5 (branch: foo) foo (child of fc7fcdd90fdb)
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   619
  |
45712
0a330055340c absorb: update commit hash references in the new commits
Matt Harbison <matt_harbison@yahoo.com>
parents: 45170
diff changeset
   620
  o  3:fc7fcdd90fdb (branch: default) a
44983
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   621
      a |  1 +
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   622
      b |  0
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   623
      2 files changed, 1 insertions(+), 0 deletions(-)
1b757f385549 absorb: preserve branch-changing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 42566
diff changeset
   624
  
44984
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   625
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   626
  $ cd ..
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   627
  $ hg init repo7
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   628
  $ cd repo7
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   629
  $ echo a1 > a
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   630
  $ touch b
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   631
  $ hg commit -m a -A a b
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   632
  $ echo b > b
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   633
  $ hg commit -m foo --close-branch  # will become empty
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   634
  $ echo c > c
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   635
  $ hg commit -m reopen -A c -q
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   636
  $ hg commit -m bar --close-branch  # is already empty
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   637
  $ echo a2 > a
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   638
  $ printf '' > b
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   639
  $ hg absorb --apply-changes --verbose | grep became
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   640
  0:0cde1ae39321: 1 file(s) changed, became 4:fc7fcdd90fdb
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   641
  1:651b953d5764: 2 file(s) changed, became 5:0c9de988ecdc
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   642
  2:76017bba73f6: 2 file(s) changed, became 6:d53ac896eb25
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   643
  3:c7c1d67efc1d: 2 file(s) changed, became 7:66520267fe96
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   644
  $ hg up null -q  # to make visible closed heads
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   645
  $ hg log -T '{rev} {desc}\n' -G --stat
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   646
  _  7 bar
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   647
  |
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   648
  o  6 reopen
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   649
  |   c |  1 +
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   650
  |   1 files changed, 1 insertions(+), 0 deletions(-)
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   651
  |
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   652
  _  5 foo
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   653
  |
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   654
  o  4 a
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   655
      a |  1 +
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   656
      b |  0
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   657
      2 files changed, 1 insertions(+), 0 deletions(-)
bfef35bb4ecb absorb: preserve branch-closing changesets even if empty
Manuel Jacob <me@manueljacob.de>
parents: 44983
diff changeset
   658
  
44985
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   659
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   660
  $ cd ..
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   661
  $ hg init repo8
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   662
  $ cd repo8
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   663
  $ echo a1 > a
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   664
  $ hg commit -m a -A a
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   665
  $ hg commit -m empty --config ui.allowemptycommit=True
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   666
  $ echo a2 > a
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   667
  $ hg absorb --apply-changes --verbose | grep became
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   668
  0:ecf99a8d6699: 1 file(s) changed, became 2:7e3ccf8e2fa5
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   669
  1:97f72456ae0d: 1 file(s) changed, became 3:2df488325d6f
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   670
  $ hg log -T '{rev} {desc}\n' -G --stat
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   671
  @  3 empty
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   672
  |
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   673
  o  2 a
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   674
      a |  1 +
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   675
      1 files changed, 1 insertions(+), 0 deletions(-)
1ca0047fd7e1 absorb: preserve changesets which were already empty
Manuel Jacob <me@manueljacob.de>
parents: 44984
diff changeset
   676