2014-10-18 00:35:52 +04:00
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> smartlog = $TESTDIR/../smartlog.py
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
Build up a repo
|
|
|
|
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
2015-09-16 02:13:13 +03:00
|
|
|
|
|
|
|
Confirm smartlog doesn't error on an empty repo
|
|
|
|
$ hg smartlog
|
|
|
|
|
|
|
|
Continue repo setup
|
2014-10-18 00:35:52 +04:00
|
|
|
$ hg book master
|
2015-09-16 02:13:13 +03:00
|
|
|
$ hg sl -r 'smartlog() + master'
|
2014-10-18 00:35:52 +04:00
|
|
|
$ touch a1 && hg add a1 && hg ci -ma1
|
|
|
|
$ touch a2 && hg add a2 && hg ci -ma2
|
|
|
|
$ hg book feature1
|
|
|
|
$ touch b && hg add b && hg ci -mb
|
|
|
|
$ hg up -q master
|
|
|
|
$ touch c1 && hg add c1 && hg ci -mc1
|
|
|
|
created new head
|
|
|
|
$ touch c2 && hg add c2 && hg ci -mc2
|
|
|
|
$ hg book feature2
|
|
|
|
$ touch d && hg add d && hg ci -md
|
|
|
|
$ hg log -G -T compact
|
|
|
|
@ 5[tip][feature2] db92053d5c83 1970-01-01 00:00 +0000 test
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
| c1
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
o 0 df4fd610a3d6 1970-01-01 00:00 +0000 test
|
|
|
|
a1
|
|
|
|
|
|
|
|
|
|
|
|
Basic test
|
|
|
|
$ hg smartlog -T compact
|
|
|
|
@ 5[tip][feature2] db92053d5c83 1970-01-01 00:00 +0000 test
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
2014-11-11 05:45:39 +03:00
|
|
|
With commit info
|
|
|
|
$ echo "hello" >c2 && hg ci --amend
|
hgext: fix many tests, run-tests, writecg2 for hg3.3
Summary: Still need to fix pushrebase
Test Plan: ##run-tests.py##
Reviewers: sid0, daviser, davidsp, mitrandir, akushner, rmcelroy, pyd, mpm, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D1813630
Signature: t1:1813630:1422573745:c5ea2a8acdfda0e555d1ae56a16f4fb5e5618174
2015-01-30 02:06:06 +03:00
|
|
|
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/db92053d5c83-f9f5e1aa-amend-backup.hg (glob)
|
2014-11-11 05:45:39 +03:00
|
|
|
$ hg smartlog -T compact --commit-info
|
|
|
|
@ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
|
|
|
| d
|
|
|
|
|
|
|
|
|
| M c2
|
|
|
|
| A d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
2015-01-21 23:20:33 +03:00
|
|
|
As a revset
|
|
|
|
$ hg log -G -T compact -r 'smartlog()'
|
2015-01-22 22:34:42 +03:00
|
|
|
@ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-01-21 23:20:33 +03:00
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| | b
|
|
|
|
| |
|
|
|
|
|
2015-02-20 01:39:54 +03:00
|
|
|
With --master
|
2015-05-19 03:36:21 +03:00
|
|
|
$ hg smartlog -T compact --master 1
|
2015-02-24 22:51:16 +03:00
|
|
|
@ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 01:39:54 +03:00
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
| c1
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
2015-01-21 23:20:33 +03:00
|
|
|
Specific revs
|
|
|
|
$ hg smartlog -T compact -r 2 -r 4
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
2014-11-11 05:45:39 +03:00
|
|
|
|
2015-01-21 23:20:33 +03:00
|
|
|
$ hg smartlog -T compact -r 'smartlog()' -r 0
|
2015-01-22 22:34:42 +03:00
|
|
|
@ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-01-21 23:20:33 +03:00
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
o 0 df4fd610a3d6 1970-01-01 00:00 +0000 test
|
|
|
|
a1
|
|
|
|
|
2015-02-20 02:50:16 +03:00
|
|
|
|
|
|
|
Test master ordering
|
|
|
|
$ hg boo -f master -r 49cdb4091aca
|
|
|
|
$ hg smartlog -T compact
|
|
|
|
o 2[feature1,master] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| b
|
|
|
|
|
|
2015-02-24 22:51:16 +03:00
|
|
|
| @ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 02:50:16 +03:00
|
|
|
| | d
|
|
|
|
| |
|
|
|
|
| o 4 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| | c2
|
|
|
|
| |
|
|
|
|
| o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
|/ c1
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
2015-02-20 03:03:41 +03:00
|
|
|
|
|
|
|
Test overriding master
|
|
|
|
$ hg boo -f master -r 38d85b506754
|
|
|
|
$ hg smartlog -T compact
|
2015-02-24 22:51:16 +03:00
|
|
|
@ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 03:03:41 +03:00
|
|
|
| d
|
|
|
|
|
|
|
|
|
o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| c2
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
|
|
|
$ hg smartlog -T compact --master feature1
|
|
|
|
o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| b
|
|
|
|
|
|
2015-02-24 22:51:16 +03:00
|
|
|
| @ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 03:03:41 +03:00
|
|
|
| | d
|
|
|
|
| |
|
|
|
|
| o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| | c2
|
|
|
|
| |
|
|
|
|
| o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
|/ c1
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
|
|
|
$ hg smartlog -T compact --config smartlog.master=feature1
|
|
|
|
o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| b
|
|
|
|
|
|
2015-02-24 22:51:16 +03:00
|
|
|
| @ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 03:03:41 +03:00
|
|
|
| | d
|
|
|
|
| |
|
|
|
|
| o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| | c2
|
|
|
|
| |
|
|
|
|
| o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
|/ c1
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
|
|
|
|
$ hg smartlog -T compact --config smartlog.master=feature2 --master feature1
|
|
|
|
o 2[feature1] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| b
|
|
|
|
|
|
2015-02-24 22:51:16 +03:00
|
|
|
| @ 5[tip][feature2] 05d10250273e 1970-01-01 00:00 +0000 test
|
2015-02-20 03:03:41 +03:00
|
|
|
| | d
|
|
|
|
| |
|
|
|
|
| o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| | c2
|
|
|
|
| |
|
|
|
|
| o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
|/ c1
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
2015-02-24 09:54:08 +03:00
|
|
|
|
|
|
|
Test draft branches
|
|
|
|
|
|
|
|
$ hg branch foo
|
|
|
|
marked working directory as branch foo
|
|
|
|
(branches are permanent and global, did you want a bookmark?)
|
|
|
|
$ hg commit -m 'create branch foo'
|
|
|
|
$ hg sl
|
2015-02-24 22:51:16 +03:00
|
|
|
@ changeset: 6:26d4a421c339
|
2015-02-24 09:54:08 +03:00
|
|
|
| branch: foo
|
|
|
|
| bookmark: feature2
|
|
|
|
| tag: tip
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: create branch foo
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
o changeset: 4:38d85b506754
|
|
|
|
| bookmark: master
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: c2
|
|
|
|
|
|
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o changeset: 2:49cdb4091aca
|
|
|
|
|/ bookmark: feature1
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: b
|
|
|
|
|
|
|
|
|
o changeset: 1:b68836a6e2ca
|
|
|
|
| user: test
|
|
|
|
| date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
| summary: a2
|
|
|
|
|
|
2015-04-30 01:00:31 +03:00
|
|
|
|
|
|
|
Test with weird bookmark names
|
|
|
|
|
2015-05-19 03:36:21 +03:00
|
|
|
$ hg book -r 2 foo-bar
|
|
|
|
$ hg smartlog -r 'foo-bar + .' -T compact
|
|
|
|
@ 6[tip][feature2] 26d4a421c339 1970-01-01 00:00 +0000 test
|
|
|
|
| create branch foo
|
2015-04-30 01:00:31 +03:00
|
|
|
|
|
2015-05-19 03:36:21 +03:00
|
|
|
.
|
|
|
|
.
|
|
|
|
|
|
|
|
|
| o 2[feature1,foo-bar] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
|/ b
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
$ hg smartlog --config smartlog.master=foo-bar -T compact
|
|
|
|
o 2[feature1,foo-bar] 49cdb4091aca 1970-01-01 00:00 +0000 test
|
|
|
|
| b
|
|
|
|
|
|
|
|
|
| @ 6[tip][feature2] 26d4a421c339 1970-01-01 00:00 +0000 test
|
|
|
|
| | create branch foo
|
|
|
|
| |
|
|
|
|
| .
|
|
|
|
| .
|
|
|
|
| |
|
|
|
|
| o 4[master] 38d85b506754 1970-01-01 00:00 +0000 test
|
|
|
|
| | c2
|
|
|
|
| |
|
|
|
|
| o 3:1 ec7553f7b382 1970-01-01 00:00 +0000 test
|
|
|
|
|/ c1
|
|
|
|
|
|
|
|
|
o 1 b68836a6e2ca 1970-01-01 00:00 +0000 test
|
|
|
|
| a2
|
|
|
|
|
|
|
|
|
$ hg smartlog --config smartlog.master=xxxx -T compact
|
|
|
|
abort: unknown revision 'xxxx'!
|
|
|
|
[255]
|