From 3ab35d3058f0b8fee49021bb895eba34b795da29 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 3 Apr 2009 17:06:58 -0400 Subject: [PATCH] Adding custom branch support. Just enter the URL instead of master or RELENG_1_2 etc. --- etc/phpshellsessions/cvssync | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/etc/phpshellsessions/cvssync b/etc/phpshellsessions/cvssync index 5edbc9fe4d..cbcfba5476 100644 --- a/etc/phpshellsessions/cvssync +++ b/etc/phpshellsessions/cvssync @@ -58,6 +58,7 @@ if($command_split[2]) { foreach($branches as $branchname => $branchdesc) { echo "{$branchname} \t {$branchdesc}\n"; } + echo "\nOr alternatively you may enter a custom branch URL.\n\n"; $branch = readline("> "); echo "\n"; } else { @@ -78,8 +79,20 @@ foreach($branches as $branchname => $branchdesc) { $found = true; } if(!$found) { - echo "\nInvalid branch.\n"; - exit; + if(isURL($branch)) { + echo "\n"; + echo "NOTE: $branch was not found.\n\n"; + $command = readline("Is this a custom branch URL? [y]? "); + if(strtolower($command) == "y" or $command == "") { + $GIT_REPO = $branch; + $branch = "master"; + $found = true; + } + } + if(!$found) { + echo "\nNo valid branch found. Exiting.\n\n"; + exit; + } } if($branch == "RESTORE" && $g['platform'] == "pfSense") { @@ -196,4 +209,11 @@ function post_cvssync_commands() { echo "\n"; } +function isUrl($url = "") { + if($url) + if(strstr($url, "rcs.pfsense.org") or strstr($url, "mainline")) + return true; + return false; +} + conf_mount_ro();