diff --git a/src/cmd_fetch.zig b/src/cmd_fetch.zig index 717cbef456ca3e346fc4a2e6e96008becf2e15d6..143eebf4ebfe015c27a1047f788c6acf9c1055c7 100644 --- a/src/cmd_fetch.zig +++ b/src/cmd_fetch.zig @@ -112,10 +112,10 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module { }, .hg => { if (!try u.does_file_exist(p)) { - _= try u.run_cmd(null, &[_][]const u8{"hg", "clone", d.path, p}); + _ = try d.type.pull(d.path, p); } else { - _= try u.run_cmd(p, &[_][]const u8{"hg", "pull"}); + _ = try d.type.update(p, d.path); } }, } diff --git a/src/util/dep_type.zig b/src/util/dep_type.zig index 201b5d996831636211b9bbaf008f5183b4dc5ea0..e5bfd964c46d3b648a402ae56307a73d92f2d490 100644 --- a/src/util/dep_type.zig +++ b/src/util/dep_type.zig @@ -12,6 +12,7 @@ pub const DepType = enum { .git => { _ = try u.run_cmd(null, &[_][]const u8{"git", "clone", rpath, dpath}); }, + .hg => { _ = try u.run_cmd(null, &[_][]const u8{"hg", "clone", rpath, dpath}); }, else => { u.assert(false, "dep type {} not configured for pull: {}", .{@tagName(self), rpath}); }, @@ -24,6 +25,7 @@ pub const DepType = enum { _ = try u.run_cmd(dpath, &[_][]const u8{"git", "fetch"}); _ = try u.run_cmd(dpath, &[_][]const u8{"git", "pull"}); }, + .hg => { _ = try u.run_cmd(dpath, &[_][]const u8{"hg", "pull"}); }, else => { u.assert(false, "dep type {} not configured for update: {}", .{@tagName(self), rpath}); },