From 13c0d09c25d70f9af2535bced230055adfc13a76 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 23 Aug 2011 15:03:51 +0200 Subject: [PATCH] get-branches is in lptools now, too. --- debian/changelog | 4 +- debian/control | 2 - debian/copyright | 2 - doc/get-branches.1 | 47 ------------------ get-branches | 118 --------------------------------------------- setup.py | 1 - 6 files changed, 2 insertions(+), 172 deletions(-) delete mode 100644 doc/get-branches.1 delete mode 100755 get-branches diff --git a/debian/changelog b/debian/changelog index 50bad01..799351a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ ubuntu-dev-tools (0.129) UNRELEASED; urgency=low - * Remove grab-attachments, lp-project-upload, lp-list-bugs, lp-set-dup - and lp-shell which are now included in lptools. + * Remove get-branches, grab-attachments, lp-project-upload, lp-list-bugs, + lp-set-dup and lp-shell which are now included in lptools. -- Jelmer Vernooij Wed, 17 Aug 2011 12:47:59 +0200 diff --git a/debian/control b/debian/control index b559f72..dc3c578 100644 --- a/debian/control +++ b/debian/control @@ -76,8 +76,6 @@ Description: useful tools for Ubuntu developers - debian-distro-info - provides information about Debian's distributions. - dgetlp - download a source package from the Launchpad library. - distro-info - provides information about the distributions' releases. - - get-branches - used to branch/checkout all the bzr branches in a Launchpad - team. - get-build-deps - install the build dependencies needed for a package reading debian/control. - grab-merge - grabs a merge from merges.ubuntu.com easily. diff --git a/debian/copyright b/debian/copyright index cbedb06..95dc1c0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -81,7 +81,6 @@ License: GPL-2+ Files: ack-sync doc/bitesize.1 - doc/get-branches.1 doc/grab-merge.1 doc/harvest.1 doc/hugdaylist.1 @@ -90,7 +89,6 @@ Files: ack-sync doc/setup-packaging-environment.1 doc/syncpackage.1 bitesize - get-branches grab-merge harvest hugdaylist diff --git a/doc/get-branches.1 b/doc/get-branches.1 deleted file mode 100644 index 848fcb7..0000000 --- a/doc/get-branches.1 +++ /dev/null @@ -1,47 +0,0 @@ -.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 -.RB [ \-d -.IR directory ] -.RB [ \-o -.BR branch | checkout ] -.B \-t -.I team -.br -.B get\-branches -.I team -.br -.B get\-branches \-\-help - -.SH DESCRIPTION -\fBget\-branches\fR uses the LP API to get a list of branches for a person or -team and calls Bazaar to download all branches. - -.SH OPTIONS -Listed below are the command line options for \fBget\-branches\fR: -.TP -.BR \-h ", " \-\-help -Display a help message and exit. -.TP -.BR \-d ", " \-\-directory -Download branches to a directory other than the current directory. -.TP -.BR \-o ", " \-\-operation -Specifies which Bazaar operation to use when downloading the branches; may be -either \fIbranch\fR or \fIcheckout\fR. -.TP -.BR \-t ", " \-\-team -Specifies which Launchpad team/person to download branches from. -This option is required. - -.SH AUTHORS -\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 -.B bzr(1) diff --git a/get-branches b/get-branches deleted file mode 100755 index 57a0e0b..0000000 --- a/get-branches +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2007 Canonical Ltd. -# Created by Daniel Holbach -# Modified by Jonathan Patrick Davies -# -# ################################################################## -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; version 3. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# See file /usr/share/common-licenses/GPL-3 for more details. -# -# ################################################################## -# -# This script is used to checkout or branch all the Bazaar branches -# of a Launchpad team. -# - -import os -import sys -from optparse import OptionParser -from ubuntutools.lp.lpapicache import PersonTeam -from ubuntutools import subprocess - -def main(): - usage = "Usage: %prog [-d ] -t [-o ]" - usage += "\nUsage: %prog " - opt_parser = OptionParser(usage) - - # Our options. - opt_parser.add_option("-d", "--directory", action="store", type="string", - dest="directory", default=os.getcwd(), - help="Directory to download branches to.") - opt_parser.add_option("-t", "--team", action="store", type="string", - dest="lpteam", - help="Launchpad team to download branches from.") - opt_parser.add_option("-o", "--operation", action="store", type="string", - dest="operation", default="branch", - help="Whether to branch or checkout the Bazaar " - "branches. May be either 'branch' or " - "'checkout'.") - - (options, args) = opt_parser.parse_args() - - # Fetch our current directory to return to later. - pwd = os.getcwd() - - # Parse our options. - if len(args) != 1 and options.lpteam == None: - opt_parser.error("No team has been specified.") - - # Dictionary settings. - directory = options.directory - if not os.path.isdir(directory): # Check that it is a directory. - opt_parser.error("%s is not a valid directory." % directory) - os.chdir(directory) - - # Type of Bazaar operation to perform. - operation_type = options.operation.lower() - if operation_type not in ("branch", "checkout"): - opt_parser.error("Invalid operation '%s' for '-o' flag." % \ - operation_type) - - # Launchpad team setting. - if options.lpteam: - team = options.lpteam.lower() - if args: - team = args[0].lower() - try: - team = PersonTeam(team) - except KeyError: - print >> sys.stderr, "E: The team '%s' doesn't exist." % team - - # Get a list of branches - branches = team.getBranches() - - print "Downloading all branches for the '%s' team. This may take some " \ - "time." % team.display_name - - try: - os.makedirs(team.name) - except: - pass - - os.chdir(team.name) - - for branch in branches: - project_name = branch.project.name - if not os.path.exists(project_name): - os.makedirs(project_name) - os.chdir(project_name) - - if not os.path.exists(branch.name): - print "Branching %s ..." % branch.display_name - cmd = ["bzr", operation_type, branch.bzr_identity, branch.name] - subprocess.call(cmd) - else: - print "Merging %s ..." % branch.display_name - os.chdir(branch.name) - subprocess.call(["bzr", "merge", "--pull", "--remember"]) - os.chdir(os.path.join(directory, team.name)) - - os.chdir(pwd) - sys.exit(0) - -if __name__ == "__main__": - try: - main() - except KeyboardInterrupt: - print "Operation was interrupted by user." diff --git a/setup.py b/setup.py index 4086f77..2c3215b 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ scripts = ['404main', 'check-symbols', 'dch-repeat', 'dgetlp', - 'get-branches', 'get-build-deps', 'grab-merge', 'grep-merges',