-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement sapling source control provider
Summary: You can now use conventional tools in a sapling repo (maybe). Test Plan: This has not really been tested yet, but the code is there. This is very much a WIP, the users will be using this at their own risk.
- Loading branch information
1 parent
efce8f6
commit cb2ae2b
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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,25 @@ | ||
import {run} from '../exec'; | ||
import type {SourceControlProvider} from '.'; | ||
|
||
const sapling: SourceControlProvider = { | ||
isEnabled: async () => { | ||
const isSapling = await run(`sl root`); | ||
return isSapling.code === 0; | ||
}, | ||
|
||
getBranchName: async () => { | ||
const {stdout} = await run(`sl log -r '.' -T"{bookmarks}"`); | ||
if (!stdout.trim()) { | ||
return null; | ||
} | ||
|
||
return stdout.trim(); | ||
}, | ||
|
||
root: async () => { | ||
const {stdout} = await run(`sl root`); | ||
return stdout.trim(); | ||
}, | ||
}; | ||
|
||
export default sapling; |
This file contains 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