rhg: add a test for --rev with a hex changeset ID
And fix error message formatting
Differential Revision: https://phab.mercurial-scm.org/D9478
--- a/rust/rhg/src/commands/cat.rs Tue Dec 01 02:07:15 2020 +0100
+++ b/rust/rhg/src/commands/cat.rs Mon Nov 30 19:26:54 2020 +0100
@@ -70,7 +70,7 @@
)),
CatRevErrorKind::InvalidRevision => CommandErrorKind::Abort(Some(
utf8_to_local(&format!(
- "abort: invalid revision identifier{}\n",
+ "abort: invalid revision identifier {}\n",
rev
))
.into(),
--- a/rust/rhg/src/commands/files.rs Tue Dec 01 02:07:15 2020 +0100
+++ b/rust/rhg/src/commands/files.rs Mon Nov 30 19:26:54 2020 +0100
@@ -85,7 +85,7 @@
ListRevTrackedFilesErrorKind::InvalidRevision => {
CommandErrorKind::Abort(Some(
utf8_to_local(&format!(
- "abort: invalid revision identifier{}\n",
+ "abort: invalid revision identifier {}\n",
rev
))
.into(),
--- a/tests/test-rhg.t Tue Dec 01 02:07:15 2020 +0100
+++ b/tests/test-rhg.t Mon Nov 30 19:26:54 2020 +0100
@@ -116,6 +116,26 @@
$ rhg cat -r 1 copy_of_original
original content
+Specifying revisions by changeset ID
+ $ hg log
+ changeset: 1:41263439dc17
+ tag: tip
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add copy of original
+
+ changeset: 0:1c9e69808da7
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: add original
+
+ $ rhg files -r 41263439dc17
+ abort: invalid revision identifier 41263439dc17
+ [255]
+ $ rhg cat -r 41263439dc17 original
+ abort: invalid revision identifier 41263439dc17
+ [255]
+
Requirements
$ rhg debugrequirements
dotencode