@@ -297,6 +297,32 @@ 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+ dir , _ := filepath .Split (vg .dir )
304+ err := os .MkdirAll (dir , 0755 )
305+ if err != nil {
306+ return err
307+ }
308+
309+ args := []string {"clone" }
310+ if vg .branch != "" {
311+ args = append (args , "--channel" , vg .branch )
312+ }
313+ args = append (args , vg .url .String (), vg .dir )
314+
315+ return run (vg .silent )("pijul" , args ... )
316+ },
317+ Update : func (vg * vcsGetOption ) error {
318+ return runInDir (vg .silent )(vg .dir , "pijul" , "pull" )
319+ },
320+ Init : func (dir string ) error {
321+ return cmdutil .RunInDir (dir , "pijul" , "init" )
322+ },
323+ Contents : []string {".pijul" },
324+ }
325+
300326var cvsDummyBackend = & VCSBackend {
301327 Clone : func (vg * vcsGetOption ) error {
302328 return errors .New ("CVS clone is not supported" )
@@ -370,6 +396,7 @@ var vcsRegistry = map[string]*VCSBackend{
370396 "hg" : MercurialBackend ,
371397 "mercurial" : MercurialBackend ,
372398 "darcs" : DarcsBackend ,
399+ "pijul" : PijulBackend ,
373400 "fossil" : FossilBackend ,
374401 "bzr" : BazaarBackend ,
375402 "bazaar" : BazaarBackend ,
0 commit comments