Patchwork D9478: rhg: add a test for --rev with a hex changeset ID

login
register
mail settings
Submitter phabricator
Date Dec. 1, 2020, 6:27 p.m.
Message ID <differential-rev-PHID-DREV-bsgz7ynwp4wo2d3oveku-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47761/
State Superseded
Headers show

Comments

phabricator - Dec. 1, 2020, 6:27 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  And fix error message formatting

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9478

AFFECTED FILES
  rust/rhg/src/commands/cat.rs
  rust/rhg/src/commands/files.rs
  tests/test-rhg.t

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -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
diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
--- a/rust/rhg/src/commands/files.rs
+++ b/rust/rhg/src/commands/files.rs
@@ -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 --git a/rust/rhg/src/commands/cat.rs b/rust/rhg/src/commands/cat.rs
--- a/rust/rhg/src/commands/cat.rs
+++ b/rust/rhg/src/commands/cat.rs
@@ -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(),