-
-
Notifications
You must be signed in to change notification settings - Fork 151
feat: Implement mercurial (hg) adapter #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
c005e5d
feat: implement FileHistory for hg
zegervdv 89c9556
feat: implement diffview for hg
zegervdv 3410b70
fix: handle no tracked files changed
zegervdv 71f0518
fix: handle null base rev
zegervdv 5850136
WIP: Amend docs
sindrets b5c8a0d
fix: correct order of flag options
zegervdv 463f60a
fix: only set oldname when a file is renamed
zegervdv 264929e
fix: only walk the mergestate data once
zegervdv 0ed37cb
feat: add log args for hg
zegervdv 6ee4efa
feat: add to_range for hg revs
zegervdv eec216e
fixup! feat: add log args for hg
zegervdv bbca98d
feat: add get_merge_context for hg
zegervdv 7298a7f
doc: list hg options and refer to documentation where possible
zegervdv 5175646
feat: add file_restore for hg
zegervdv 4a5b609
fix review comments
zegervdv b267549
fix: update flags
zegervdv 9c6c81d
fix: return first ancestorlinknode as merge-base
zegervdv dafbf1a
fix: use direct arguments to indicate range (WIP)
zegervdv c0e80ed
fixup! fix: use direct arguments to indicate range (WIP)
zegervdv 20f9698
fixup! fix: use direct arguments to indicate range (WIP)
zegervdv e3db8f4
fixup! fix: use direct arguments to indicate range (WIP)
zegervdv 868090e
fix: handle empty files
zegervdv e84d44f
fixup! fix: use direct arguments to indicate range (WIP)
zegervdv f03052e
feat: add rev completion
zegervdv 0cd8fb8
fix: match file names from numstat output correctly
zegervdv 673b58f
fix: return error message from HgAdapter.create
zegervdv 660ec69
fix: address review comments
zegervdv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| local lazy = require("diffview.lazy") | ||
| local oop = require('diffview.oop') | ||
| local utils = require("diffview.utils") | ||
| local Commit = require('diffview.vcs.commit').Commit | ||
|
|
||
| local M = {} | ||
|
|
||
| ---@class HgCommit : Commit | ||
| local HgCommit = oop.create_class('HgCommit', Commit) | ||
|
|
||
| function HgCommit:init(opt) | ||
| HgCommit:super().init(self, opt) | ||
|
|
||
| if opt.time_offset then | ||
| self.time_offset = HgCommit.parse_time_offset(opt.time_offset) | ||
| self.time = self.time - self.time_offset | ||
| else | ||
| self.time_offset = 0 | ||
| end | ||
|
|
||
| self.iso_date = Commit.time_to_iso(self.time, self.time_offset) | ||
| end | ||
|
|
||
| ---@param iso_date string? | ||
| function HgCommit.parse_time_offset(iso_date) | ||
| if not iso_date or iso_date == "" then | ||
| return 0 | ||
| end | ||
|
|
||
| local sign, offset = vim.trim(iso_date):match("([+-])(%d+)") | ||
|
|
||
| offset = tonumber(offset) | ||
|
|
||
| if sign == "-" then | ||
| offset = -offset | ||
| end | ||
|
|
||
| return offset | ||
| end | ||
|
|
||
| M.HgCommit = HgCommit | ||
| return M |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.