[Updated] [+ ] D11402: rust-revset: support explicit `.` revision

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Mon Sep 13 15:39:47 UTC 2021


Alphare updated this revision to Diff 30219.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11402?vs=30207&id=30219

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11402/new/

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

AFFECTED FILES
  rust/hg-core/src/revset.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/revset.rs b/rust/hg-core/src/revset.rs
--- a/rust/hg-core/src/revset.rs
+++ b/rust/hg-core/src/revset.rs
@@ -20,6 +20,10 @@
     let changelog = Changelog::open(repo)?;
 
     match input {
+        "." => {
+            let p1 = repo.dirstate_parents()?.p1;
+            return Ok(changelog.revlog.get_node_rev(p1.into())?);
+        }
         "null" => return Ok(NULL_REVISION),
         _ => {}
     }



To: Alphare, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210913/22d1f5eb/attachment-0002.html>


More information about the Mercurial-patches mailing list