# HG changeset patch # User Simon Sapin # Date 1606760814 -3600 # Node ID 904647f7d9831ffa36293f8217b3b26810706187 # Parent 32dcd783a98582ab13b43a050a74f50c64dffda0 rhg: add a test for --rev with a hex changeset ID And fix error message formatting Differential Revision: https://phab.mercurial-scm.org/D9478 diff -r 32dcd783a985 -r 904647f7d983 rust/rhg/src/commands/cat.rs --- 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(), diff -r 32dcd783a985 -r 904647f7d983 rust/rhg/src/commands/files.rs --- 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(), diff -r 32dcd783a985 -r 904647f7d983 tests/test-rhg.t --- 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