@@ -41,8 +41,8 @@ pub const DepType = enum {
4141 },
4242 .fossil = > {
4343 try std .fs .cwd ().makePath (dpath );
44- u .assert ((try u .run_cmd (dpath , &.{ "fossil" , "open" , rpath })) == 0 , "fossil open {s} failed" , .{rpath });
45- }
44+ u .assert ((try u .run_cmd (alloc , dpath , &.{ "fossil" , "open" , rpath })) == 0 , "fossil open {s} failed" , .{rpath });
45+ },
4646 }
4747 }
4848
@@ -64,8 +64,8 @@ pub const DepType = enum {
6464 //
6565 },
6666 .fossil = > {
67- u .assert ((try u .run_cmd (dpath , &.{ "fossil" , "pull" })) == 0 , "fossil pull failed" , .{});
68- u .assert ((try u .run_cmd (dpath , &.{ "fossil" , "update" })) == 0 , "fossil update failed" , .{});
67+ u .assert ((try u .run_cmd (alloc , dpath , &.{ "fossil" , "pull" })) == 0 , "fossil pull failed" , .{});
68+ u .assert ((try u .run_cmd (alloc , dpath , &.{ "fossil" , "update" })) == 0 , "fossil update failed" , .{});
6969 },
7070 }
7171 }
@@ -80,7 +80,7 @@ pub const DepType = enum {
8080 .git = > try std .fmt .allocPrint (alloc , "commit-{s}" , .{(try u .git_rev_HEAD (alloc , mdir ))}),
8181 .hg = > "" ,
8282 .http = > "" ,
83- .fossil = > getFossilCheckout (mpath ),
83+ .fossil = > getFossilCheckout (alloc , mpath ),
8484 };
8585 }
8686
@@ -92,6 +92,7 @@ pub const DepType = enum {
9292 .git = > false ,
9393 .hg = > false ,
9494 .http = > false ,
95+ .fossil = > false ,
9596 };
9697 }
9798
@@ -102,6 +103,7 @@ pub const DepType = enum {
102103 git : Git ,
103104 hg : void ,
104105 http : void ,
106+ fossil : void ,
105107
106108 pub const Git = enum {
107109 branch ,
@@ -119,20 +121,18 @@ pub const DepType = enum {
119121 };
120122};
121123
122-
123- fn getFossilCheckout (mpath : []const u8 ) ! []const u8 {
124- const result = try u .run_cmd_raw (mpath , &.{"fossil" , "status" });
125- gpa .free (result .stderr );
126- defer gpa .free (result .stdout );
124+ fn getFossilCheckout (alloc : std.mem.Allocator , mpath : []const u8 ) ! []const u8 {
125+ const result = try u .run_cmd_raw (alloc , mpath , &.{ "fossil" , "status" });
126+ alloc .free (result .stderr );
127+ defer alloc .free (result .stdout );
127128
128129 var iter = std .mem .tokenize (u8 , result .stdout , " \n " );
129130 while (iter .next ()) | tk | {
130131 if (std .mem .eql (u8 , tk , "checkout:" )) {
131132 const co = iter .next () orelse return "" ;
132- return try gpa .dupe (u8 , co );
133+ return try alloc .dupe (u8 , co );
133134 }
134135 }
135136
136137 return "" ;
137138}
138-
0 commit comments