@@ -297,6 +297,33 @@ var DarcsBackend = &VCSBackend{
297297 Contents : []string {"_darcs" },
298298}
299299
300+ // PijulBackend is the VCSBackend for pijul
301+ var PijulBackend = & VCSBackend {
302+ Clone : func (vg * vcsGetOption ) error {
303+ if vg .branch != "" {
304+ return errors .New ("pijul does not support branch" )
305+ }
306+
307+ dir , _ := filepath .Split (vg .dir )
308+ err := os .MkdirAll (dir , 0755 )
309+ if err != nil {
310+ return err
311+ }
312+
313+ args := []string {"clone" }
314+ args = append (args , vg .url .String (), vg .dir )
315+
316+ return run (vg .silent )("pijul" , args ... )
317+ },
318+ Update : func (vg * vcsGetOption ) error {
319+ return runInDir (vg .silent )(vg .dir , "pijul" , "pull" )
320+ },
321+ Init : func (dir string ) error {
322+ return cmdutil .RunInDir (dir , "pijul" , "init" )
323+ },
324+ Contents : []string {".pijul" },
325+ }
326+
300327var cvsDummyBackend = & VCSBackend {
301328 Clone : func (vg * vcsGetOption ) error {
302329 return errors .New ("CVS clone is not supported" )
@@ -370,6 +397,7 @@ var vcsRegistry = map[string]*VCSBackend{
370397 "hg" : MercurialBackend ,
371398 "mercurial" : MercurialBackend ,
372399 "darcs" : DarcsBackend ,
400+ "pijul" : PijulBackend ,
373401 "fossil" : FossilBackend ,
374402 "bzr" : BazaarBackend ,
375403 "bazaar" : BazaarBackend ,
0 commit comments