[jhbuild] rewritten checkbranches command for git.gnome.org
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] rewritten checkbranches command for git.gnome.org
- Date: Thu, 16 Apr 2009 18:11:49 -0400 (EDT)
commit 86f429cbbf120c03be79cf16832ec38830da828a
Author: Frederic Peters <fpeters 0d be>
Date: Fri Apr 17 00:11:14 2009 +0200
rewritten checkbranches command for git.gnome.org
---
jhbuild/commands/checkbranches.py | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/jhbuild/commands/checkbranches.py b/jhbuild/commands/checkbranches.py
index 399a80b..07f04bd 100644
--- a/jhbuild/commands/checkbranches.py
+++ b/jhbuild/commands/checkbranches.py
@@ -17,13 +17,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-import urllib2
from optparse import make_option
import jhbuild.moduleset
from jhbuild.commands import Command, register_command
+from jhbuild.utils.cmds import get_output
+from jhbuild.errors import CommandError
class cmd_checkbranches(Command):
doc = _('Check modules in GNOME subversion have the correct branch definition')
@@ -49,21 +48,21 @@ class cmd_checkbranches(Command):
for mod in module_list:
if mod.type in ('meta', 'tarball'):
continue
- if not mod.branch or not mod.branch.repository.__class__.__name__ == 'SubversionRepository':
+ if not mod.branch or not mod.branch.repository.__class__.__name__ == 'GitRepository':
continue
- if not 'svn.gnome.org' in mod.branch.repository.href:
+ if not 'git.gnome.org' in mod.branch.repository.href:
continue
- rev = mod.branch.revision
- if rev:
+ if mod.branch.branch:
+ # there is already a branch defined
continue
- url = 'http://svn.gnome.org/svn/%s/branches/%s' % (mod.name, branch)
try:
- st = urllib2.urlopen(url).read()
- except urllib2.URLError:
+ if get_output(['git', 'ls-remote',
+ 'git://git.gnome.org/%s' % mod.name,
+ 'refs/heads/%s' % branch]):
+ uprint(_('%(module)s is missing branch definition for %(branch)s') % {'module': mod.name, 'branch': branch})
+ except CommandError:
pass
- else:
- uprint(_('%(module)s is missing branch definition for %(branch)s') % {'module': mod.name, 'branch': branch})
register_command(cmd_checkbranches)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]