From 59a6f32e8e35f762540af618b72834a00d43851b Mon Sep 17 00:00:00 2001 From: Jonathan Patrick Davies Date: Mon, 11 Aug 2008 07:57:58 +0100 Subject: [PATCH] * get-branches: - Improve invalid directory error. - Check that the team page exists before creating new directory for downloads. * doc/get-branches.1: Created. --- debian/changelog | 1 + doc/get-branches.1 | 45 +++++++++++++++++++++++++++++++++++++++++++++ get-branches | 5 +++-- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 doc/get-branches.1 diff --git a/debian/changelog b/debian/changelog index d9a2efe..385be90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ ubuntu-dev-tools (0.37ubuntu1) intrepid; urgency=low [ Jonathan Patrick Davies ] * get-branches: Open the teams code page before making a new directory. + * doc/get-branches.1: Created. -- Jonathan Patrick Davies Sun, 10 August 2008 22:07:58 +0100 diff --git a/doc/get-branches.1 b/doc/get-branches.1 new file mode 100644 index 0000000..d0f29be --- /dev/null +++ b/doc/get-branches.1 @@ -0,0 +1,45 @@ +.TH GET-BRANCHES "1" "11 August 2008" "ubuntu-dev-tools" +.SH NAME +get-branches \- downloads all branches related to a Launchpad team or person + +.SH SYNOPSIS + +.B get-branches [-d directory] [-o branch|checkout] \-t + +.B get-branches + +.B get-branches \-\-help + +.SH DESCRIPTION +.PP +\fBget-branches\fR examines the code page of a Launchpad team/person, parses it, +and calls Bazaar to download all branches on that page. + +.SH OPTIONS +.PP +Listed below are the command line options for \fBget-branches\fR: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-d or \-\-directory +Download branches to a directory other than the current directory. +.TP +.B \-o or \-\-operation +Specifies which Bazaar operation to use when downloading the branches; may be +either \fIbranch\fR or \fIcheckout\fR. +.TP +.B \-t or \-\-team +Specifies which Launchpad team/person to download branches from. This option is +required. + +.SH AUTHORS +.PP +\fBget-branches\fR was written by Daniel Holbach , and +this manual page was written by Jonathan Patrick Davies . +.PP +Both are released under the terms of the GNU General Public License, version 3. + +.SH SEE ALSO +.PP +.B bzr(1) diff --git a/get-branches b/get-branches index fd83c5c..886a758 100755 --- a/get-branches +++ b/get-branches @@ -59,7 +59,8 @@ def main(): sys.exit(1) if not os.path.isdir(directory): # Check that it is a directory. - print >> sys.stderr, "%s is not a directory." % directory + print >> sys.stderr, "%s is not a valid directory." % directory + optParser.print_help() sys.exit(1) else: directory = os.path.abspath(args[0]) @@ -138,7 +139,7 @@ def main(): branch_url_regex = r'bzr branch lp:~(.*)' branch_url = re.findall(branch_url_regex, branch_page) - print "Downloading branch:", branch_url[0] + print "Downloading branch: lp:~%s." % branch_url[0] if branch_url[0]: product = branch_url[0].split("/")[-2]