Permalink
Browse files

Add support for disabling lanes.

  • Loading branch information...
rolfbjarne committed Sep 25, 2013
1 parent 0fe7e05 commit 6242bc10f77b16c30b7a87a716d3becbf7b798ab
@@ -38,6 +38,7 @@ public partial class DBLane : DBRecord
private int? _parent_lane_id;
private string _commit_filter;
private bool _traverse_merge;
+ private bool _enabled;
public string @lane { get { return _lane; } set { _lane = value; } }
public string @source_control { get { return _source_control; } set { _source_control = value; } }
@@ -47,6 +48,7 @@ public partial class DBLane : DBRecord
public int? @parent_lane_id { get { return _parent_lane_id; } set { _parent_lane_id = value; } }
public string @commit_filter { get { return _commit_filter; } set { _commit_filter = value; } }
public bool @traverse_merge { get { return _traverse_merge; } set { _traverse_merge = value; } }
+ public bool @enabled { get { return _enabled; } set { _enabled = value; } }
public override string Table
@@ -59,7 +61,7 @@ public override string Table
{
get
{
- return new string [] { "lane", "source_control", "repository", "min_revision", "max_revision", "parent_lane_id", "commit_filter", "traverse_merge" };
+ return new string [] { "lane", "source_control", "repository", "min_revision", "max_revision", "parent_lane_id", "commit_filter", "traverse_merge", "enabled" };
}
}
@@ -456,6 +456,7 @@ public DBLane CloneLane (int lane_id, string new_name, bool copy_files)
result.repository = master.repository;
result.source_control = master.source_control;
result.parent_lane_id = master.parent_lane_id;
+ result.enabled = master.enabled;
result.Save (this);
foreach (DBLanefile filemaster in master.GetFiles (this, null)) {
@@ -126,6 +126,11 @@ public static bool ExecuteScheduler (bool forcefullupdate)
// SVNUpdater svn_updater = null;
foreach (DBLane lane in lanes) {
+ if (!lane.enabled) {
+ Logger.Log ("Schedule: lane {0} is disabled, skipping it.", lane.lane);
+ continue;
+ }
+
SchedulerBase updater;
switch (lane.source_control) {
/*
@@ -64,6 +64,13 @@
</asp:TableCell>
<asp:TableCell>If merged-in commits (except the merge commit itself, which is always included) should be included.</asp:TableCell>
</asp:TableRow>
+ <asp:TableRow>
+ <asp:TableCell>Enabled:</asp:TableCell>
+ <asp:TableCell>
+ <asp:CheckBox ID="chkEnabled" runat="server" Width="600px"></asp:CheckBox>
+ </asp:TableCell>
+ <asp:TableCell>If a lane is enabled. If not enabled nothing will be done for it and it won't show up on the front page.</asp:TableCell>
+ </asp:TableRow>
<asp:TableRow>
<asp:TableCell>
</asp:TableCell>
@@ -108,6 +108,7 @@ protected override void OnInit (EventArgs e)
}
}
chkTraverseMerges.Checked = lane.traverse_merge;
+ chkEnabled.Checked = lane.enabled;
}
if (!string.IsNullOrEmpty (action)) {
@@ -631,6 +632,7 @@ protected void cmdSave_Click (object sender, EventArgs e)
lane.source_control = cmbSourceControl.Text;
lane.parent_lane_id = (parent_lane_id.HasValue && parent_lane_id.Value != 0) ? parent_lane_id : null;
lane.traverse_merge = chkTraverseMerges.Checked;
+ lane.enabled = chkEnabled.Checked;
Master.WebService.EditLane (Master.WebServiceLogin, lane);
RedirectToSelf ();
}
Oops, something went wrong.

0 comments on commit 6242bc1

Please sign in to comment.