Find the revision of a node given its full hash.
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHG4f11a67a12fb: hg-core: add `Revlog.get_node_rev`
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
rust/hg-core/src/revlog/revlog.rs | ||
---|---|---|
82 | I know Clippy will complain about the lack of is_empty method when you have a len method, if you want to add it quickly. | |
91 | Wouldn't it make more sense to start from the end as we're more likely to be looking for recent nodes? Also, it's not clear by looking at this that this bruteforce method is not the one we'll use in the future, using @gracinet's nodemap. I think a small comment would be enough. |
rust/hg-core/src/revlog/revlog.rs | ||
---|---|---|
82 | I've seen the clippy warning, but did not added it because it wasn't needed and since it's not enforced by an interface, I was not sure about what to do about it. Maybe having 0 warning on easy things should be a goal. | |
91 | Like you said we're more likely to be looking for recent nodes thus searching from the start when the revolg is huge is probably not the way to go. |
rust/hg-core/src/revlog/revlog.rs | ||
---|---|---|
82 | It has been added in another commit. I moved the code here |
I know Clippy will complain about the lack of is_empty method when you have a len method, if you want to add it quickly.