obshistory: rename the command to "olog"
The command start to look good enough to be handed out to user. We replace the
old and useless "olog" alias in favor of the new command.
--- a/README Thu May 18 18:04:47 2017 +0200
+++ b/README Thu May 18 18:18:01 2017 +0200
@@ -115,7 +115,7 @@
6.2.0 - in progress
-------------------
- - add a debugobshistory command to inspect the obs-history of a changeset
+ - olog: turn into a proper command to inspect the obs-history of a changeset
- topic: have thg display topic name if possible,
- obscache: more efficient update in the (rare) case of a transaction adding
markers without changesets
--- a/hgext3rd/evolve/__init__.py Thu May 18 18:04:47 2017 +0200
+++ b/hgext3rd/evolve/__init__.py Thu May 18 18:18:01 2017 +0200
@@ -280,9 +280,6 @@
ui.setconfig('alias', 'pstatus', 'status --rev .^', 'evolve')
if ui.config('alias', 'pdiff', None) is None:
ui.setconfig('alias', 'pdiff', 'diff --rev .^', 'evolve')
- if ui.config('alias', 'olog', None) is None:
- ui.setconfig('alias', 'olog', "log -r 'precursors(.)' --hidden",
- 'evolve')
if ui.config('alias', 'odiff', None) is None:
ui.setconfig('alias', 'odiff',
"diff --hidden --rev 'limit(precursors(.),1)' --rev .",
--- a/hgext3rd/evolve/obshistory.py Thu May 18 18:04:47 2017 +0200
+++ b/hgext3rd/evolve/obshistory.py Thu May 18 18:18:01 2017 +0200
@@ -25,11 +25,11 @@
eh = exthelper.exthelper()
@eh.command(
- '^debugobshistory',
+ 'olog',
[('G', 'graph', True, _("show the revision DAG")),
('r', 'rev', [], _('show the specified revision or revset'), _('REV'))
] + commands.formatteropts,
- _('hg debugobshistory [OPTION]... [REV]'))
+ _('hg olog [OPTION]... [REV]'))
def cmdobshistory(ui, repo, *revs, **opts):
"""show the obsolescence history of the specified revisions.
--- a/tests/test-evolve-obshistory.t Thu May 18 18:04:47 2017 +0200
+++ b/tests/test-evolve-obshistory.t Thu May 18 18:18:01 2017 +0200
@@ -53,13 +53,13 @@
Actual test
-----------
- $ hg debugobshistory 4ae3a4151de9
+ $ hg olog 4ae3a4151de9
@ 4ae3a4151de9 (3) A1
|
x 471f378eab4c (1) A0
rewritten by test (*20*) as 4ae3a4151de9 (glob)
- $ hg debugobshistory 4ae3a4151de9 --no-graph -Tjson | python -m json.tool
+ $ hg olog 4ae3a4151de9 --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -86,11 +86,11 @@
"debugobshistory.shortdescription": "A0"
}
]
- $ hg debugobshistory --hidden 471f378eab4c
+ $ hg olog --hidden 471f378eab4c
x 471f378eab4c (1) A0
rewritten by test (*20*) as 4ae3a4151de9 (glob)
- $ hg debugobshistory --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
+ $ hg olog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [
@@ -173,11 +173,11 @@
Actual test
-----------
- $ hg debugobshistory 'desc(B0)' --hidden
+ $ hg olog 'desc(B0)' --hidden
x 0dec01379d3b (2) B0
pruned by test (*20*) (glob)
- $ hg debugobshistory 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool
+ $ hg olog 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [
@@ -195,10 +195,10 @@
"debugobshistory.shortdescription": "B0"
}
]
- $ hg debugobshistory 'desc(A0)'
+ $ hg olog 'desc(A0)'
@ 471f378eab4c (1) A0
- $ hg debugobshistory 'desc(A0)' --no-graph -Tjson | python -m json.tool
+ $ hg olog 'desc(A0)' --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -306,11 +306,11 @@
-----------
Check that debugobshistory on splitted commit show both targets
- $ hg debugobshistory 471597cad322 --hidden
+ $ hg olog 471597cad322 --hidden
x 471597cad322 (1) A0
rewritten by test (*20*) as 337fec4d2edc, f257fde29c7a (glob)
- $ hg debugobshistory 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
+ $ hg olog 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [
@@ -334,7 +334,7 @@
]
Check that debugobshistory on the first successor after split show
the revision plus the splitted one
- $ hg debugobshistory 337fec4d2edc
+ $ hg olog 337fec4d2edc
o 337fec4d2edc (2) A0
|
x 471597cad322 (1) A0
@@ -342,7 +342,7 @@
Check that debugobshistory on the second successor after split show
the revision plus the splitted one
- $ hg debugobshistory f257fde29c7a
+ $ hg olog f257fde29c7a
@ f257fde29c7a (3) A0
|
x 471597cad322 (1) A0
@@ -350,7 +350,7 @@
Check that debugobshistory on both successors after split show
a coherent graph
- $ hg debugobshistory 'f257fde29c7a+337fec4d2edc'
+ $ hg olog 'f257fde29c7a+337fec4d2edc'
o 337fec4d2edc (2) A0
|
| @ f257fde29c7a (3) A0
@@ -520,11 +520,11 @@
Actual test
-----------
- $ hg debugobshistory de7290d8b885 --hidden
+ $ hg olog de7290d8b885 --hidden
x de7290d8b885 (1) A0
rewritten by test (*20*) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a (glob)
- $ hg debugobshistory de7290d8b885 --hidden --no-graph -Tjson | python -m json.tool
+ $ hg olog de7290d8b885 --hidden --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [
@@ -548,13 +548,13 @@
"debugobshistory.shortdescription": "A0"
}
]
- $ hg debugobshistory c7f044602e9b
+ $ hg olog c7f044602e9b
@ c7f044602e9b (5) A0
|
x de7290d8b885 (1) A0
rewritten by test (*20*) as 1ae8bc733a14, 337fec4d2edc, c7f044602e9b, f257fde29c7a (glob)
- $ hg debugobshistory c7f044602e9b --no-graph -Tjson | python -m json.tool
+ $ hg olog c7f044602e9b --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -585,7 +585,7 @@
}
]
Check that debugobshistory on all heads show a coherent graph
- $ hg debugobshistory 2::5
+ $ hg olog 2::5
o 1ae8bc733a14 (4) A0
|
| o 337fec4d2edc (2) A0
@@ -665,19 +665,19 @@
Check that debugobshistory on the first folded revision show only
the revision with the target
- $ hg debugobshistory --hidden 471f378eab4c
+ $ hg olog --hidden 471f378eab4c
x 471f378eab4c (1) A0
rewritten by test (*20*) as eb5a0daa2192 (glob)
Check that debugobshistory on the second folded revision show only
the revision with the target
- $ hg debugobshistory --hidden 0dec01379d3b
+ $ hg olog --hidden 0dec01379d3b
x 0dec01379d3b (2) B0
rewritten by test (*20*) as eb5a0daa2192 (glob)
Check that debugobshistory on the successor revision show a coherent
graph
- $ hg debugobshistory eb5a0daa2192
+ $ hg olog eb5a0daa2192
@ eb5a0daa2192 (3) C0
|\
x | 0dec01379d3b (2) B0
@@ -686,7 +686,7 @@
x 471f378eab4c (1) A0
rewritten by test (*20*) as eb5a0daa2192 (glob)
- $ hg debugobshistory eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+ $ hg olog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -815,12 +815,12 @@
-----------
Check that debugobshistory on the divergent revision show both destinations
- $ hg debugobshistory --hidden 471f378eab4c
+ $ hg olog --hidden 471f378eab4c
x 471f378eab4c (1) A0
rewritten by test (*20*) as 65b757b745b9 (glob)
rewritten by test (*20*) as fdf9bde5129a (glob)
- $ hg debugobshistory --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
+ $ hg olog --hidden 471f378eab4c --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [
@@ -854,7 +854,7 @@
]
Check that debugobshistory on the first diverged revision show the revision
and the diverent one
- $ hg debugobshistory fdf9bde5129a
+ $ hg olog fdf9bde5129a
o fdf9bde5129a (2) A1
|
x 471f378eab4c (1) A0
@@ -863,7 +863,7 @@
Check that debugobshistory on the second diverged revision show the revision
and the diverent one
- $ hg debugobshistory 65b757b745b9
+ $ hg olog 65b757b745b9
@ 65b757b745b9 (3) A2
|
x 471f378eab4c (1) A0
@@ -872,7 +872,7 @@
Check that debugobshistory on the both diverged revision show a coherent
graph
- $ hg debugobshistory '65b757b745b9+fdf9bde5129a'
+ $ hg olog '65b757b745b9+fdf9bde5129a'
@ 65b757b745b9 (3) A2
|
| o fdf9bde5129a (2) A1
@@ -881,7 +881,7 @@
rewritten by test (*20*) as 65b757b745b9 (glob)
rewritten by test (*20*) as fdf9bde5129a (glob)
- $ hg debugobshistory '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
+ $ hg olog '65b757b745b9+fdf9bde5129a' --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -1005,7 +1005,7 @@
-----------
Check that debugobshistory on head show a coherent graph
- $ hg debugobshistory eb5a0daa2192
+ $ hg olog eb5a0daa2192
@ eb5a0daa2192 (4) C0
|\
x | 471f378eab4c (1) A0
@@ -1017,7 +1017,7 @@
x 0dec01379d3b (2) B0
rewritten by test (*20*) as b7ea6d14e664 (glob)
- $ hg debugobshistory eb5a0daa2192 --no-graph -Tjson | python -m json.tool
+ $ hg olog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
[
{
"debugobshistory.markers": [],
@@ -1169,7 +1169,7 @@
Actual test
-----------
- $ hg debugobshistory 7a230b46bf61
+ $ hg olog 7a230b46bf61
@ 7a230b46bf61 (3) A2
|
x fdf9bde5129a (2) A1
@@ -1192,7 +1192,7 @@
(use 'hg evolve' to update to its successor: 7a230b46bf61)
Check that debugobshistory works with markers pointing to missing local
changectx
- $ hg debugobshistory 7a230b46bf61
+ $ hg olog 7a230b46bf61
o 7a230b46bf61 (2) A2
|
x fdf9bde5129a
@@ -1201,7 +1201,7 @@
@ 471f378eab4c (1) A0
rewritten by test (*20*) as fdf9bde5129a (glob)
- $ hg debugobshistory 7a230b46bf61 --color=debug
+ $ hg olog 7a230b46bf61 --color=debug
o [evolve.node|7a230b46bf61] [evolve.rev|(2)] [evolve.short_description|A2]
|
x [evolve.node evolve.missing_change_ctx|fdf9bde5129a]
@@ -1282,7 +1282,7 @@
Check that debugobshistory never crash on a cycle
- $ hg debugobshistory "desc(A)" --hidden
+ $ hg olog "desc(A)" --hidden
@ 2a34000d3544 (1) A
| rewritten by test (*20*) as c473644ee0e9 (glob)
|
@@ -1293,7 +1293,7 @@
| rewritten by test (*20*) as a8df460dbbfe (glob)
|
- $ hg debugobshistory "desc(B)" --hidden
+ $ hg olog "desc(B)" --hidden
@ 2a34000d3544 (1) A
| rewritten by test (*20*) as c473644ee0e9 (glob)
|
@@ -1304,7 +1304,7 @@
| rewritten by test (*20*) as a8df460dbbfe (glob)
|
- $ hg debugobshistory "desc(C)" --hidden
+ $ hg olog "desc(C)" --hidden
@ 2a34000d3544 (1) A
| rewritten by test (*20*) as c473644ee0e9 (glob)
|
@@ -1426,7 +1426,7 @@
Check that debugobshistory never crash on a cycle
- $ hg debugobshistory "desc(D)" --hidden
+ $ hg olog "desc(D)" --hidden
x 0da815c333f6 (5) E
| rewritten by test (*20*) as d9f908fde1a1 (glob)
|
--- a/tests/test-evolve.t Thu May 18 18:04:47 2017 +0200
+++ b/tests/test-evolve.t Thu May 18 18:18:01 2017 +0200
@@ -769,9 +769,20 @@
Test olog
- $ hg olog
- 4 : add 4 - test
- 11 : add 3 - test
+ $ hg olog | head -n 13 # hg touch makes the output unstable (fix it with devel option for more stable touch)
+ @ d26d339c513f (12) add 4
+ |\
+ x | af636757ce3b (11) add 3
+ |\ \ rewritten by test (*) as d26d339c513f (glob)
+ | | |
+ | \ \
+ | |\ \
+ | | | x ce341209337f (4) add 4
+ | | | rewritten by test (*) as d26d339c513f (glob)
+ | | |
+ x | | 0b9e50c35132 (5) add 3
+ | | | rewritten by test (*) as af636757ce3b (glob)
+ | | |
Test obsstore stat
--- a/tests/test-obsolete.t Thu May 18 18:04:47 2017 +0200
+++ b/tests/test-obsolete.t Thu May 18 18:18:01 2017 +0200
@@ -692,10 +692,12 @@
[10] add obsol_c
[2]
$ hg olog
- changeset: 2:4538525df7e2
- user: test
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: add c
+ @ 0d3f46688ccc (3) add obsol_c
+ | rewritten by test (*) as 2033b4e49474 (glob)
+ | rewritten by test (Thu Jan 01 00:00:00 1970 +0000) as 725c380fe99b
+ |
+ x 4538525df7e2 (2) add c
+ rewritten by test (Thu Jan 01 00:00:00 1970 +0000) as 0d3f46688ccc
Check import reports new unstable changeset: