comparison rust/hg-core/src/revset.rs @ 48079:3da7bf75fdb2

rust-revset: support explicit `.` revision This is basically the same thing as not specifying a revision, except this is done in the revset resolution function. This allows calls like `rhg cat some-file -r .` to work without falling back. Differential Revision: https://phab.mercurial-scm.org/D11402
author Rapha?l Gom?s <rgomes@octobus.net>
date Sat, 11 Sep 2021 00:09:29 +0200
parents ddde80830aea
children e98fd81bb151
comparison
equal deleted inserted replaced
48078:ddde80830aea 48079:3da7bf75fdb2
17 repo: &Repo, 17 repo: &Repo,
18 ) -> Result<Revision, RevlogError> { 18 ) -> Result<Revision, RevlogError> {
19 let changelog = repo.changelog()?; 19 let changelog = repo.changelog()?;
20 20
21 match input { 21 match input {
22 "." => {
23 let p1 = repo.dirstate_parents()?.p1;
24 return Ok(changelog.revlog.rev_from_node(p1.into())?);
25 }
22 "null" => return Ok(NULL_REVISION), 26 "null" => return Ok(NULL_REVISION),
23 _ => {} 27 _ => {}
24 } 28 }
25 29
26 match resolve_rev_number_or_hex_prefix(input, &changelog.revlog) { 30 match resolve_rev_number_or_hex_prefix(input, &changelog.revlog) {