-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6610 Add pijul to known repository type
- Loading branch information
Showing
5 changed files
with
152 additions
and
2 deletions.
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
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
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 |
---|---|---|
|
@@ -50,18 +50,24 @@ tests mtimeChange = | |
[ testGroup "check VCS test framework" $ | ||
[ testProperty "git" prop_framework_git | ||
] ++ | ||
[ testProperty "pijul" prop_framework_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_framework_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
, testGroup "cloneSourceRepo" $ | ||
[ testProperty "git" prop_cloneRepo_git | ||
] ++ | ||
[ testProperty "pijul" prop_cloneRepo_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_cloneRepo_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
, testGroup "syncSourceRepos" $ | ||
[ testProperty "git" prop_syncRepos_git | ||
] ++ | ||
[ testProperty "pijul" prop_syncRepos_pijul | ||
] ++ | ||
[ testProperty "darcs" (prop_syncRepos_darcs mtimeChange) | ||
| enableDarcsTests | ||
] | ||
|
@@ -83,6 +89,12 @@ prop_framework_darcs mtimeChange = | |
. prop_framework vcsDarcs (vcsTestDriverDarcs mtimeChange) | ||
. WithoutBranchingSupport | ||
|
||
prop_framework_pijul :: BranchingRepoRecipe -> Property | ||
prop_framework_pijul = | ||
ioProperty | ||
. prop_framework vcsPijul vcsTestDriverPijul | ||
. WithBranchingSupport | ||
|
||
prop_cloneRepo_git :: BranchingRepoRecipe -> Property | ||
prop_cloneRepo_git = | ||
ioProperty | ||
|
@@ -96,6 +108,12 @@ prop_cloneRepo_darcs mtimeChange = | |
. prop_cloneRepo vcsDarcs (vcsTestDriverDarcs mtimeChange) | ||
. WithoutBranchingSupport | ||
|
||
prop_cloneRepo_pijul :: BranchingRepoRecipe -> Property | ||
prop_cloneRepo_pijul = | ||
ioProperty | ||
. prop_cloneRepo vcsPijul vcsTestDriverPijul | ||
. WithBranchingSupport | ||
|
||
prop_syncRepos_git :: RepoDirSet -> SyncTargetIterations -> PrngSeed | ||
-> BranchingRepoRecipe -> Property | ||
prop_syncRepos_git destRepoDirs syncTargetSetIterations seed = | ||
|
@@ -113,6 +131,13 @@ prop_syncRepos_darcs mtimeChange destRepoDirs syncTargetSetIterations seed = | |
destRepoDirs syncTargetSetIterations seed | ||
. WithoutBranchingSupport | ||
|
||
prop_syncRepos_pijul :: RepoDirSet -> SyncTargetIterations -> PrngSeed | ||
-> BranchingRepoRecipe -> Property | ||
prop_syncRepos_pijul destRepoDirs syncTargetSetIterations seed = | ||
ioProperty | ||
. prop_syncRepos vcsPijul vcsTestDriverPijul | ||
destRepoDirs syncTargetSetIterations seed | ||
. WithBranchingSupport | ||
|
||
-- ------------------------------------------------------------ | ||
-- * General test setup | ||
|
@@ -693,3 +718,45 @@ vcsTestDriverDarcs mtimeChange verbosity vcs repoRoot = | |
} | ||
darcs = runProgramInvocation verbosity . darcsInvocation | ||
|
||
|
||
vcsTestDriverPijul :: Verbosity -> VCS ConfiguredProgram | ||
-> FilePath -> VCSTestDriver | ||
vcsTestDriverPijul _verbosity vcs repoRoot = | ||
VCSTestDriver { | ||
vcsVCS = vcs | ||
|
||
, vcsRepoRoot = repoRoot | ||
|
||
, vcsIgnoreFiles = Set.empty | ||
|
||
, vcsInit = | ||
pijul $ ["init"] | ||
|
||
, vcsAddFile = \_ filename -> | ||
pijul ["add", filename] | ||
|
||
, vcsCommitChanges = \_state -> do | ||
pijul $ ["record", "-a", "-m 'a patch'" | ||
, "-A 'A <[email protected]>'" | ||
] | ||
commit <- pijul' ["log"] | ||
let commit' = takeWhile (not . isSpace) commit | ||
return (Just commit') | ||
|
||
, vcsTagState = \_ tagname -> | ||
pijul ["tag", tagname] | ||
|
||
, vcsSwitchBranch = \RepoState{allBranches} branchname -> do | ||
unless (branchname `Map.member` allBranches) $ | ||
pijul ["from-branch", branchname] | ||
pijul $ ["checkout", branchname] | ||
|
||
, vcsCheckoutTag = Left $ \tagname -> | ||
pijul $ ["checkout", tagname] | ||
} | ||
where | ||
gitInvocation args = (programInvocation (vcsProgram vcs) args) { | ||
progInvokeCwd = Just repoRoot | ||
} | ||
pijul = runProgramInvocation verbosity . gitInvocation | ||
pijul' = getProgramInvocationOutput verbosity . gitInvocation |