authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 13:13:23 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-28 13:13:23 -08:00
log337d392073fa5613f8f7be01bb096c97a86c39d7
tree69434c28ccf2bd97b75924060694f07dbecf9ad1
parentde608bf1d26bc8b5ac39c6e657d5d9b70cb0c9b0

add mercurial commands to deptype


2 files changed, 4 insertions(+), 2 deletions(-)

src/cmd_fetch.zig+2-2
...@@ -112,10 +112,10 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {...@@ -112,10 +112,10 @@ fn fetch_deps(dir: []const u8, mpath: []const u8) anyerror!u.Module {
112 },112 },
113 .hg => {113 .hg => {
114 if (!try u.does_file_exist(p)) {114 if (!try u.does_file_exist(p)) {
115 _= try u.run_cmd(null, &[_][]const u8{"hg", "clone", d.path, p});115 _ = try d.type.pull(d.path, p);
116 }116 }
117 else {117 else {
118 _= try u.run_cmd(p, &[_][]const u8{"hg", "pull"});118 _ = try d.type.update(p, d.path);
119 }119 }
120 },120 },
121 }121 }
src/util/dep_type.zig+2
...@@ -12,6 +12,7 @@ pub const DepType = enum {...@@ -12,6 +12,7 @@ pub const DepType = enum {
12 .git => {12 .git => {
13 _ = try u.run_cmd(null, &[_][]const u8{"git", "clone", rpath, dpath});13 _ = try u.run_cmd(null, &[_][]const u8{"git", "clone", rpath, dpath});
14 },14 },
15 .hg => { _ = try u.run_cmd(null, &[_][]const u8{"hg", "clone", rpath, dpath}); },
15 else => {16 else => {
16 u.assert(false, "dep type {} not configured for pull: {}", .{@tagName(self), rpath});17 u.assert(false, "dep type {} not configured for pull: {}", .{@tagName(self), rpath});
17 },18 },
...@@ -24,6 +25,7 @@ pub const DepType = enum {...@@ -24,6 +25,7 @@ pub const DepType = enum {
24 _ = try u.run_cmd(dpath, &[_][]const u8{"git", "fetch"});25 _ = try u.run_cmd(dpath, &[_][]const u8{"git", "fetch"});
25 _ = try u.run_cmd(dpath, &[_][]const u8{"git", "pull"});26 _ = try u.run_cmd(dpath, &[_][]const u8{"git", "pull"});
26 },27 },
28 .hg => { _ = try u.run_cmd(dpath, &[_][]const u8{"hg", "pull"}); },
27 else => {29 else => {
28 u.assert(false, "dep type {} not configured for update: {}", .{@tagName(self), rpath});30 u.assert(false, "dep type {} not configured for update: {}", .{@tagName(self), rpath});
29 },31 },