Commits

Palmer, 2E0EOL committed 7b7025e

Start working on this.

  • Participants

Comments (0)

Files changed (1)

+#!/usr/bin/perl -w
+#
+# This script can be used to check if a given named branch has been merged into develop.
+# if the branch is not specified, the branch of the present workspace is used.
+#
+# The script will exit with error code 1 if the present branch is not merged.
+#
+
+package main;
+use strict;
+use warnings;
+use diagnostics;
+use constant BRANCH_MAINLINE => 'develop';
+
+sub GetWSNamedBranchName() {
+	my $b = `hg branch`;
+	chomp($b);
+	return $b;
+}
+
+sub Main()
+{
+	my $b = $ARGV[0] || GetWSNamedBranchName();
+	if ( !$b ) {
+		print(STDERR "Unable to determine branch name\n");
+		return 2;
+	} elsif ( $b eq BRANCH_MAINLINE() ) {
+		printf(STDERR "Mainline %s branch is %s itself (it is always merged)\n", BRANCH_MAINLINE(), BRANCH_MAINLINE());
+		return 0;
+	}
+	if ( BranchExists($b) ) {
+	}
+}
+exit(Main());