| 1 |
$ cat >> $HGRCPATH << EOF |
| 2 |
> [extensions] |
| 3 |
> absorb= |
| 4 |
> EOF |
| 5 |
|
| 6 |
$ hg init repo1 |
| 7 |
$ cd repo1 |
| 8 |
|
| 9 |
Make some commits: |
| 10 |
|
| 11 |
$ for i in 1 2 3; do |
| 12 |
> echo $i >> a |
| 13 |
> hg commit -A a -m "commit $i" -q |
| 14 |
> done |
| 15 |
|
| 16 |
absorb --edit-lines will run the editor if filename is provided: |
| 17 |
|
| 18 |
$ hg absorb --edit-lines |
| 19 |
nothing applied |
| 20 |
[1] |
| 21 |
$ HGEDITOR=cat hg absorb --edit-lines a |
| 22 |
HG: editing a |
| 23 |
HG: "y" means the line to the right exists in the changeset to the top |
| 24 |
HG: |
| 25 |
HG: /---- 4ec16f85269a commit 1 |
| 26 |
HG: |/--- 5c5f95224a50 commit 2 |
| 27 |
HG: ||/-- 43f0a75bede7 commit 3 |
| 28 |
HG: ||| |
| 29 |
yyy : 1 |
| 30 |
yy : 2 |
| 31 |
y : 3 |
| 32 |
nothing applied |
| 33 |
[1] |
| 34 |
|
| 35 |
Edit the file using --edit-lines: |
| 36 |
|
| 37 |
$ cat > editortext << EOF |
| 38 |
> y : a |
| 39 |
> yy : b |
| 40 |
> y : c |
| 41 |
> yy : d |
| 42 |
> y y : e |
| 43 |
> y : f |
| 44 |
> yyy : g |
| 45 |
> EOF |
| 46 |
$ HGEDITOR='cat editortext >' hg absorb -q --edit-lines a |
| 47 |
$ hg cat -r 0 a |
| 48 |
d |
| 49 |
e |
| 50 |
f |
| 51 |
g |
| 52 |
$ hg cat -r 1 a |
| 53 |
b |
| 54 |
c |
| 55 |
d |
| 56 |
g |
| 57 |
$ hg cat -r 2 a |
| 58 |
a |
| 59 |
b |
| 60 |
e |
| 61 |
g |