2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
We assume that log basically works (it has its own tests). This just covers uses
|
|
|
|
of show that might break even if log works.
|
|
|
|
|
|
|
|
Show on empty repository: checking consistency
|
|
|
|
|
|
|
|
$ hg init empty
|
|
|
|
$ cd empty
|
|
|
|
$ hg show
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 000000000000
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user:
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-01 13:12:01 +03:00
|
|
|
Add log alias to and make sure show still works
|
|
|
|
$ hg show --config alias.log=log
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 000000000000
|
2018-03-01 13:12:01 +03:00
|
|
|
user:
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
|
|
|
|
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
$ hg show 1
|
|
|
|
abort: unknown revision '1'!
|
|
|
|
[255]
|
|
|
|
$ hg show 'branch(name)'
|
2019-02-23 07:58:37 +03:00
|
|
|
abort: unknown revision branch(name)
|
|
|
|
(if branch(name) is a file, try `hg show . branch(name)`)
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
[255]
|
|
|
|
$ hg show null -q
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 000000000000
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user:
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
|
|
|
|
|
2016-02-12 14:07:11 +03:00
|
|
|
Check various git-like options:
|
|
|
|
|
|
|
|
$ hg init gitlike
|
|
|
|
$ echo one > one
|
|
|
|
$ echo two > two
|
|
|
|
$ hg commit -qAm twofiles
|
|
|
|
$ hg show --template status
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: bf7b98b60f6f
|
2016-02-12 14:07:11 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
description:
|
|
|
|
twofiles
|
|
|
|
|
|
|
|
files:
|
|
|
|
A one
|
|
|
|
A two
|
|
|
|
|
|
|
|
diff -r 000000000000 -r bf7b98b60f6f one
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/one Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+one
|
|
|
|
diff -r 000000000000 -r bf7b98b60f6f two
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/two Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+two
|
|
|
|
|
|
|
|
|
|
|
|
Check that the command parser always treats the first argument as a revision:
|
|
|
|
|
|
|
|
$ hg show two
|
|
|
|
abort: unknown revision 'two'!
|
|
|
|
[255]
|
|
|
|
$ hg show . two
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: bf7b98b60f6f
|
2016-02-12 14:07:11 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: one two
|
|
|
|
description:
|
|
|
|
twofiles
|
|
|
|
|
|
|
|
|
|
|
|
diff -r 000000000000 -r bf7b98b60f6f two
|
|
|
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/two Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+two
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
|
|
|
Check --stat
|
|
|
|
|
|
|
|
$ hg init stat
|
|
|
|
$ cd stat
|
|
|
|
$ echo show > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ hg show --stat
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 852a8d467a01
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: x
|
|
|
|
description:
|
|
|
|
x
|
|
|
|
|
|
|
|
|
|
|
|
x | 1 +
|
|
|
|
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ echo more >> x
|
|
|
|
$ hg commit -qAm longer
|
|
|
|
$ hg show --stat
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: b73358b94785
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: x
|
|
|
|
description:
|
|
|
|
longer
|
|
|
|
|
|
|
|
|
|
|
|
x | 1 +
|
|
|
|
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ echo remove > x
|
|
|
|
$ hg commit -qAm remove
|
|
|
|
$ hg show --stat
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 3d74ea61c11c
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: x
|
|
|
|
description:
|
|
|
|
remove
|
|
|
|
|
|
|
|
|
|
|
|
x | 3 +--
|
|
|
|
1 files changed, 1 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg show --stat 'desc(x)'
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 852a8d467a01
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: x
|
|
|
|
description:
|
|
|
|
x
|
|
|
|
|
|
|
|
|
|
|
|
x | 1 +
|
|
|
|
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
|
|
|
2017-05-15 15:59:55 +03:00
|
|
|
Check --unified and -U
|
|
|
|
|
|
|
|
$ hg init diff
|
|
|
|
$ cd diff
|
|
|
|
$ cat >file <<EOF
|
|
|
|
> line1
|
|
|
|
> line2
|
|
|
|
> line3
|
|
|
|
> line4
|
|
|
|
> line5
|
|
|
|
> EOF
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ cat >>file <<EOF
|
|
|
|
> line6
|
|
|
|
> line7
|
|
|
|
> line8
|
|
|
|
> line9
|
|
|
|
> line10
|
|
|
|
> EOF
|
|
|
|
$ hg commit -qm file
|
|
|
|
$ hg show --unified=1
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 8e33115c1596
|
2017-05-15 15:59:55 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r fd78c1ae39e0 -r 8e33115c1596 file
|
|
|
|
--- a/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -5,1 +5,6 @@
|
|
|
|
line5
|
|
|
|
+line6
|
|
|
|
+line7
|
|
|
|
+line8
|
|
|
|
+line9
|
|
|
|
+line10
|
|
|
|
|
|
|
|
$ hg show --unified=2
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 8e33115c1596
|
2017-05-15 15:59:55 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r fd78c1ae39e0 -r 8e33115c1596 file
|
|
|
|
--- a/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -4,2 +4,7 @@
|
|
|
|
line4
|
|
|
|
line5
|
|
|
|
+line6
|
|
|
|
+line7
|
|
|
|
+line8
|
|
|
|
+line9
|
|
|
|
+line10
|
|
|
|
|
|
|
|
|
|
|
|
Check behavior with nonsensical integers.
|
|
|
|
$ hg show --unified=-7
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 8e33115c1596
|
2017-05-15 15:59:55 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r fd78c1ae39e0 -r 8e33115c1596 file
|
|
|
|
--- a/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -13,-14 +13,-9 @@
|
|
|
|
+line6
|
|
|
|
+line7
|
|
|
|
+line8
|
|
|
|
+line9
|
|
|
|
+line10
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-23 23:08:34 +03:00
|
|
|
Check whitespace handling options
|
|
|
|
$ hg init whitespace
|
|
|
|
$ cd whitespace
|
|
|
|
$ echo "some text" > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ echo "some text " > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 6dbf2c12e2e2
|
2018-01-23 23:08:34 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r 5b445d2a372e -r 6dbf2c12e2e2 file
|
|
|
|
--- a/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ b/file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -1,1 +1,1 @@
|
|
|
|
-some text
|
|
|
|
+some text
|
|
|
|
|
|
|
|
$ hg show -b
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 6dbf2c12e2e2
|
2018-01-23 23:08:34 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ echo "some text" > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show -Z
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 600038806867
|
2018-01-23 23:08:34 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ echo "some text " > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show -Z
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 747594f0817c
|
2018-01-23 23:08:34 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ printf "some\n\ntext" > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ printf "some\ntext" > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show -B
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 10f3fc1d00d6
|
2018-01-23 23:08:34 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
Check --git and -g
|
|
|
|
|
|
|
|
$ hg init git
|
|
|
|
$ cd git
|
|
|
|
$ echo git > file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show --git
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 2a575d662478
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/file b/file
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/file
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ echo more >> file
|
|
|
|
$ hg commit -qAm file
|
|
|
|
$ hg show -g
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: a23f7b259024
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/file b/file
|
|
|
|
--- a/file
|
|
|
|
+++ b/file
|
|
|
|
@@ -1,1 +1,2 @@
|
|
|
|
git
|
|
|
|
+more
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-08 21:06:31 +03:00
|
|
|
$ hg show -g 2a575d662478590c06bc0cb3988882b46c0b2fee
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: 2a575d662478
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/file b/file
|
|
|
|
new file mode 100644
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/file
|
|
|
|
@@ -0,0 +1,1 @@
|
|
|
|
+git
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-26 16:37:10 +03:00
|
|
|
Check nodates
|
|
|
|
$ hg show --nodates
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: a23f7b259024
|
2018-02-26 16:37:10 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r 2a575d662478 -r a23f7b259024 file
|
|
|
|
--- a/file
|
|
|
|
+++ b/file
|
|
|
|
@@ -1,1 +1,2 @@
|
|
|
|
git
|
|
|
|
+more
|
|
|
|
|
|
|
|
|
|
|
|
Check noprefix
|
|
|
|
$ hg show --noprefix
|
2020-07-21 03:23:52 +03:00
|
|
|
commit: a23f7b259024
|
2018-02-26 16:37:10 +03:00
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
files: file
|
|
|
|
description:
|
|
|
|
file
|
|
|
|
|
|
|
|
|
|
|
|
diff -r 2a575d662478 -r a23f7b259024 file
|
|
|
|
--- file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
+++ file Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
@@ -1,1 +1,2 @@
|
|
|
|
git
|
|
|
|
+more
|
|
|
|
|
|
|
|
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
Check hg show '' fails to parse the revision
|
|
|
|
|
|
|
|
$ hg show ''
|
|
|
|
hg: parse error: empty query
|
|
|
|
[255]
|
|
|
|
|
|
|
|
Confirm that --help works (it didn't when we used an alias)
|
|
|
|
|
|
|
|
$ hg show --help
|
2016-02-12 14:07:11 +03:00
|
|
|
hg show [OPTION]... [REV [FILE]...]
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-10-15 19:35:15 +03:00
|
|
|
show commit in detail
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-11-10 00:11:58 +03:00
|
|
|
Show the commit message and contents for the specified commit. If no
|
|
|
|
commit is specified, shows the current commit.
|
|
|
|
|
2016-02-12 14:07:11 +03:00
|
|
|
This behaves similarly to 'hg log -vp -r REV [OPTION]... [FILE]...', or if
|
2016-04-04 22:48:01 +03:00
|
|
|
called without a REV, 'hg log -vp -r . [OPTION]...' Use 'hg log' for more
|
2018-11-10 00:11:58 +03:00
|
|
|
powerful operations than supported by hg show.
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-10-15 19:35:15 +03:00
|
|
|
Options ([+] can be repeated):
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-02-26 16:37:10 +03:00
|
|
|
--nodates omit dates from diff headers (but keeps it in commit
|
|
|
|
header)
|
|
|
|
--noprefix omit a/ and b/ prefixes from filenames
|
2018-10-12 16:57:12 +03:00
|
|
|
--stat output diffstat-style summary of changes
|
|
|
|
-g --git use git extended diff format
|
2019-07-20 11:01:33 +03:00
|
|
|
-U --unified VALUE number of lines of diff context to show (default: 3)
|
2018-01-23 23:08:34 +03:00
|
|
|
-w --ignore-all-space ignore white space when comparing lines
|
|
|
|
-b --ignore-space-change ignore changes in the amount of white space
|
|
|
|
-B --ignore-blank-lines ignore changes whose lines are all blank
|
|
|
|
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
|
2018-10-12 16:57:12 +03:00
|
|
|
-T --template TEMPLATE display with template
|
|
|
|
-I --include PATTERN [+] include names matching the given patterns
|
|
|
|
-X --exclude PATTERN [+] exclude names matching the given patterns
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
|
|
|
(some details hidden, use --verbose to show complete help)
|
|
|
|
$ hg show --help --verbose
|
2016-02-12 14:07:11 +03:00
|
|
|
hg show [OPTION]... [REV [FILE]...]
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-10-15 19:35:15 +03:00
|
|
|
show commit in detail
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-11-10 00:11:58 +03:00
|
|
|
Show the commit message and contents for the specified commit. If no
|
|
|
|
commit is specified, shows the current commit.
|
|
|
|
|
2016-02-12 14:07:11 +03:00
|
|
|
This behaves similarly to 'hg log -vp -r REV [OPTION]... [FILE]...', or if
|
2016-04-04 22:48:01 +03:00
|
|
|
called without a REV, 'hg log -vp -r . [OPTION]...' Use 'hg log' for more
|
2018-11-10 00:11:58 +03:00
|
|
|
powerful operations than supported by hg show.
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-10-15 19:35:15 +03:00
|
|
|
Options ([+] can be repeated):
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-02-26 16:37:10 +03:00
|
|
|
--nodates omit dates from diff headers (but keeps it in commit
|
|
|
|
header)
|
|
|
|
--noprefix omit a/ and b/ prefixes from filenames
|
2018-10-12 16:57:12 +03:00
|
|
|
--stat output diffstat-style summary of changes
|
|
|
|
-g --git use git extended diff format
|
2019-07-20 11:01:33 +03:00
|
|
|
-U --unified VALUE number of lines of diff context to show (default: 3)
|
2018-01-23 23:08:34 +03:00
|
|
|
-w --ignore-all-space ignore white space when comparing lines
|
|
|
|
-b --ignore-space-change ignore changes in the amount of white space
|
|
|
|
-B --ignore-blank-lines ignore changes whose lines are all blank
|
|
|
|
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
|
2018-10-12 16:57:12 +03:00
|
|
|
--style STYLE display using template map file (DEPRECATED)
|
|
|
|
-T --template TEMPLATE display with template
|
|
|
|
-I --include PATTERN [+] include names matching the given patterns
|
|
|
|
-X --exclude PATTERN [+] exclude names matching the given patterns
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
2018-10-15 19:35:15 +03:00
|
|
|
Global options ([+] can be repeated):
|
Make 'hg show' a native command
Summary:
There are a few ways in which the 'hg show' alias doesn't work for users:
1) if your argument to 'hg show' isn't in exactly the right form, you get confusing messages (e.g. if you run 'hg show --help').
2) It's slow compared to 'git show', and needs speeding up. There's some low-hanging fruit identified by bryano, and having the command as a native command makes it easier to go there.
As a first step towards fixing this, reimplement the existing alias as a Python extension, aiming for minimum behaviour changes. We can inline the implementation of 'hg log' when we need to.
Test Plan:
Run the new automatic test test-show.t:
: /data/users/simonfar/fb-hgext (hg) [nativeshow]
: simonfar@devvm148 tests $ ../../hg/tests/run-tests.py -l test-show.t
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Note that this means that review needs to cover the automatic test, too, in case I've missed anything important
Reviewers: #sourcecontrol, lcharignon, ttung, rmcelroy
Reviewed By: lcharignon, rmcelroy
Subscribers: rmcelroy, lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2820421
Tasks: 9323445, 9599994
Signature: t1:2820421:1452541611:02efa59739f690b30053d93e0d47adf0aef8dbf4
2016-01-12 22:20:28 +03:00
|
|
|
|
encoding: use correct output encoding on windows
Summary:
On Windows, there are *two* 8-bit encodings for each process.
* The ANSI code page is used for all `...A` system calls, and this is what
Mercurial uses internally. It can be overridden using the `--encoding`
command line option.
* The OEM code page is used when outputing to the console. Mercurial has no
concept of this, and instead renders to the console using the ANSI code page,
which results in mojibake like "Θ" instead of "é".
Add the concept of an `outputencoding`. If this differs from `encoding`, we
convert from the local encoding to the output encoding before writing to the
console.
On non-Windows platforms, this defaults to the same encoding as the local encoding,
so this is a no-op unless `--outputencoding` is manually specified.
On Windows, this defaults to the codepage given by `GetOEMCP`, causing output
to be converted to the OEM codepage before being printed.
For ordinary strings, the local encoded version is wrapped by `localstr` if the
encoding does not round-trip cleanly. This means the output encoding works
even if the character is not represented in the local encoding.
Unfortunately, the templater is not localstr-clean, which means strings can get
flattened down to the local encoding and the original code points are lost. In
this case we can only output characters which are in the intersection of the
encoding and the output encoding.
Most US English Windows systems use cp1252 for the ANSI code page and cp437 for
the OEM code page. These both contain many accented characters, so users with
accented characters in their names will now see them correctly rendered.
All of this only applies to Python 2.7. In Python 3, everything is Unicode,
the `--encoding` and `--outputencoding` options do nothing, and it just works.
Reviewed By: quark-zju, ikostia
Differential Revision: D19951381
fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 15:27:06 +03:00
|
|
|
-R --repository REPO repository root directory or name of overlay
|
|
|
|
bundle file
|
|
|
|
--cwd DIR change working directory
|
|
|
|
-y --noninteractive do not prompt, automatically pick the first choice
|
|
|
|
for all prompts
|
|
|
|
-q --quiet suppress output
|
|
|
|
-v --verbose enable additional output
|
|
|
|
--color TYPE when to colorize (boolean, always, auto, never, or
|
|
|
|
debug)
|
|
|
|
--config CONFIG [+] set/override config option (use
|
|
|
|
'section.name=value')
|
|
|
|
--configfile FILE [+] enables the given config file
|
|
|
|
--debug enable debugging output
|
|
|
|
--debugger start debugger
|
|
|
|
--encoding ENCODE set the charset encoding (default: utf-8)
|
|
|
|
--encodingmode MODE set the charset encoding mode (default: strict)
|
|
|
|
--outputencoding ENCODE set the output encoding (default: utf-8)
|
|
|
|
--traceback always print a traceback on exception
|
2020-08-28 04:11:28 +03:00
|
|
|
--trace enable more detailed tracing
|
encoding: use correct output encoding on windows
Summary:
On Windows, there are *two* 8-bit encodings for each process.
* The ANSI code page is used for all `...A` system calls, and this is what
Mercurial uses internally. It can be overridden using the `--encoding`
command line option.
* The OEM code page is used when outputing to the console. Mercurial has no
concept of this, and instead renders to the console using the ANSI code page,
which results in mojibake like "Θ" instead of "é".
Add the concept of an `outputencoding`. If this differs from `encoding`, we
convert from the local encoding to the output encoding before writing to the
console.
On non-Windows platforms, this defaults to the same encoding as the local encoding,
so this is a no-op unless `--outputencoding` is manually specified.
On Windows, this defaults to the codepage given by `GetOEMCP`, causing output
to be converted to the OEM codepage before being printed.
For ordinary strings, the local encoded version is wrapped by `localstr` if the
encoding does not round-trip cleanly. This means the output encoding works
even if the character is not represented in the local encoding.
Unfortunately, the templater is not localstr-clean, which means strings can get
flattened down to the local encoding and the original code points are lost. In
this case we can only output characters which are in the intersection of the
encoding and the output encoding.
Most US English Windows systems use cp1252 for the ANSI code page and cp437 for
the OEM code page. These both contain many accented characters, so users with
accented characters in their names will now see them correctly rendered.
All of this only applies to Python 2.7. In Python 3, everything is Unicode,
the `--encoding` and `--outputencoding` options do nothing, and it just works.
Reviewed By: quark-zju, ikostia
Differential Revision: D19951381
fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 15:27:06 +03:00
|
|
|
--time time how long the command takes
|
|
|
|
--profile print command execution profile
|
|
|
|
--version output version information and exit
|
|
|
|
-h --help display help and exit
|
|
|
|
--hidden consider hidden changesets
|
|
|
|
--pager TYPE when to paginate (boolean, always, auto, or never)
|
|
|
|
(default: auto)
|