diff options
author | Justin Lecher <jlec@gentoo.org> | 2011-04-16 10:08:24 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2011-04-16 10:08:24 +0000 |
commit | 477bb54844a54d5443a53bae873cb55a7472266d (patch) | |
tree | ab071b5e675132bf5da4cbf64f617cec54ca9265 /dev-vcs | |
parent | Version bump. Drop old. (diff) | |
download | gentoo-2-477bb54844a54d5443a53bae873cb55a7472266d.tar.gz gentoo-2-477bb54844a54d5443a53bae873cb55a7472266d.tar.bz2 gentoo-2-477bb54844a54d5443a53bae873cb55a7472266d.zip |
Added myself as maintainer, included backport patch from HEAD, fixing issues with HOME being git repo and general repo cloning, including unicode support
(Portage version: 2.2.0_alpha30/cvs/Linux x86_64)
Diffstat (limited to 'dev-vcs')
-rw-r--r-- | dev-vcs/cola/ChangeLog | 9 | ||||
-rw-r--r-- | dev-vcs/cola/cola-1.4.3.2-r1.ebuild | 103 | ||||
-rw-r--r-- | dev-vcs/cola/files/1.4.3.2-backport.patch | 336 | ||||
-rw-r--r-- | dev-vcs/cola/metadata.xml | 4 |
4 files changed, 451 insertions, 1 deletions
diff --git a/dev-vcs/cola/ChangeLog b/dev-vcs/cola/ChangeLog index 3f6581c450e9..1daecb6adb9e 100644 --- a/dev-vcs/cola/ChangeLog +++ b/dev-vcs/cola/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-vcs/cola # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cola/ChangeLog,v 1.8 2011/04/13 19:00:02 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cola/ChangeLog,v 1.9 2011/04/16 10:08:24 jlec Exp $ + +*cola-1.4.3.2-r1 (16 Apr 2011) + + 16 Apr 2011; Justin Lecher <jlec@gentoo.org> +files/1.4.3.2-backport.patch, + +cola-1.4.3.2-r1.ebuild, metadata.xml: + Added myself as maintainer, included backport patch from HEAD, fixing issues + with HOME being git repo and general repo cloning, including unicode support *cola-1.4.3.2 (13 Apr 2011) diff --git a/dev-vcs/cola/cola-1.4.3.2-r1.ebuild b/dev-vcs/cola/cola-1.4.3.2-r1.ebuild new file mode 100644 index 000000000000..8ed7bd1a4293 --- /dev/null +++ b/dev-vcs/cola/cola-1.4.3.2-r1.ebuild @@ -0,0 +1,103 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cola/cola-1.4.3.2-r1.ebuild,v 1.1 2011/04/16 10:08:24 jlec Exp $ + +EAPI="3" + +PYTHON_DEPEND="2" + +inherit distutils eutils + +DESCRIPTION="A sweet, carbonated git gui known for its sugary flavour and caffeine-inspired features." +HOMEPAGE="http://cola.tuxfamily.org/" +SRC_URI="http://cola.tuxfamily.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc test" + +RDEPEND="dev-python/PyQt4 + >=dev-python/pyinotify-0.7.1 + dev-python/jsonpickle + >=dev-vcs/git-1.6.3" +DEPEND="${RDEPEND} + doc? ( app-text/asciidoc + dev-python/sphinx + app-text/xmlto ) + sys-devel/gettext + test? ( dev-python/nose )" + +# tests currently broken due to unfinished translation framework +RESTRICT="test" + +pkg_setup() { + python_set_active_version 2 + python_pkg_setup +} + +src_prepare() { + # don't install docs into wrong location + sed -i \ + -e '/doc/d' \ + setup.py || die "sed failed" + + sed -i \ + -e "s|'doc', 'git-cola'|'doc', '${PF}', 'html'|" \ + cola/resources.py || die "sed failed" + + # don't prefix install path with homedir + rm setup.cfg + + epatch \ + "${FILESDIR}/1.3.8-disable-tests.patch" \ + "${FILESDIR}"/${PV}-backport.patch + + python_convert_shebangs 2 bin/git-cola share/git-cola/bin/ssh-askpass +} + +src_compile() { + distutils_src_compile + + if use doc ; then + cd share/doc/git-cola/ + emake all || die "building docs failed" + fi +} + +src_install() { + distutils_src_install + + # remove bundled libraries + rm -rf "${D}"/usr/share/git-cola/lib/{jsonpickle,simplejson} + + # remove wrong translation file + rm -rf "${D}/usr/share/locale/" + + insinto /usr/share/locale + doins -r share/locale/* + + cd share/doc/git-cola/ + dodoc *.txt + + if use doc ; then + dohtml -r _build/html/* + doman *.1 + else + dohtml "${FILESDIR}/index.html" + fi +} + +src_test() { + PYTHONPATH="${S}:${S}/build/lib:${PYTHONPATH}" LC_ALL="C" nosetests \ + --verbose --with-doctest --with-id --exclude=jsonpickle --exclude=json \ + || die "running nosetests failed" +} + +pkg_postinst() { + python_mod_optimize /usr/share/git-cola/lib/cola +} + +pkg_postrm() { + python_mod_cleanup /usr/share/git-cola/lib/cola +} diff --git a/dev-vcs/cola/files/1.4.3.2-backport.patch b/dev-vcs/cola/files/1.4.3.2-backport.patch new file mode 100644 index 000000000000..00132642edcf --- /dev/null +++ b/dev-vcs/cola/files/1.4.3.2-backport.patch @@ -0,0 +1,336 @@ +Backport from HEAD, fixes following issues: + +* File -> Clone doesn't work +* Clone doesn't work with --prompt +* Always checks out $HOME.git if HOME is under git controll, when launched from desktop launcher +* Same for opening bookmarks + +From 6a09349645ca4b576a0eeac69e83adadbd7887e4 Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 01:37:14 -0700 +Subject: [PATCH 2/9] bookmarks: Handle home directories with unicode characters + +Closes #74 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/controllers/bookmark.py | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/cola/controllers/bookmark.py b/cola/controllers/bookmark.py +index 61b9c79..57cc954 100644 +--- a/cola/controllers/bookmark.py ++++ b/cola/controllers/bookmark.py +@@ -5,6 +5,7 @@ import sys + + from PyQt4 import QtGui + ++from cola import core + from cola import utils + from cola import qtutils + from cola.qobserver import QObserver +@@ -19,7 +20,7 @@ def save_bookmark(): + + """ + model = settings.SettingsManager.settings() +- model.add_bookmark(os.getcwd()) ++ model.add_bookmark(core.decode(os.getcwd())) + settings.SettingsManager.save() + qtutils.information("Bookmark Saved") + +@@ -31,6 +32,7 @@ def manage_bookmarks(): + ctl = BookmarkController(model, view) + view.show() + ++ + class BookmarkController(QObserver): + """Handles interactions with the bookmarks dialog + """ +-- +1.7.3.4 + + +From bc5940bd362a4750b2b37107a9c6272302f93bd4 Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 01:38:00 -0700 +Subject: [PATCH 3/9] guicmds: Handle cloning repos that contain unicode characters + +Closes #74 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/guicmds.py | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/cola/guicmds.py b/cola/guicmds.py +index b98a445..353bee0 100644 +--- a/cola/guicmds.py ++++ b/cola/guicmds.py +@@ -134,7 +134,7 @@ def cherry_pick(): + cola.notifier().broadcast(signals.cherry_pick, commits) + + +-def clone_repo(parent, spawn=True): ++def clone_repo(spawn=True): + """ + Present GUI controls for cloning a repository + +@@ -142,7 +142,7 @@ def clone_repo(parent, spawn=True): + + """ + url, ok = qtutils.prompt('Path or URL to clone (Env. $VARS okay)') +- url = os.path.expandvars(url) ++ url = os.path.expandvars(core.encode(url)) + if not ok or not url: + return None + try: +@@ -168,12 +168,14 @@ def clone_repo(parent, spawn=True): + return None + + # Prompt the user for a directory to use as the parent directory ++ parent = QtGui.QApplication.instance().activeWindow() + msg = 'Select a parent directory for the new clone' + dirname = qtutils.opendir_dialog(parent, msg, cola.model().getcwd()) + if not dirname: + return None + count = 1 +- destdir = os.path.join(dirname, default) ++ dirname = core.decode(dirname) ++ destdir = os.path.join(dirname, core.decode(default)) + olddestdir = destdir + if os.path.exists(destdir): + # An existing path can be specified +@@ -186,7 +188,7 @@ def clone_repo(parent, spawn=True): + while os.path.exists(destdir): + destdir = olddestdir + str(count) + count += 1 +- cola.notifier().broadcast(signals.clone, url, destdir, ++ cola.notifier().broadcast(signals.clone, core.decode(url), destdir, + spawn=spawn) + return destdir + +-- +1.7.3.4 + + +From 00f6b77ee15eba1f707dc8aab02359c0483ecff8 Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 01:38:46 -0700 +Subject: [PATCH 4/9] settings: Handle home directories with unicode characters + +Closes #74 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/settings.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/cola/settings.py b/cola/settings.py +index 74ef101..66a12b3 100644 +--- a/cola/settings.py ++++ b/cola/settings.py +@@ -5,11 +5,12 @@ + import os + import user + ++from cola import core + from cola import serializer + from cola.models import observable + + # Here we store settings +-_rcfile = os.path.join(user.home, '.cola') ++_rcfile = os.path.join(core.decode(user.home), '.cola') + + + class SettingsModel(observable.ObservableModel): +-- +1.7.3.4 + + +From 73a7191758d366e1865e729a0c834eff43a5cbda Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 01:40:07 -0700 +Subject: [PATCH 5/9] startup: Handle repository paths with unicode characters + +Closes #74 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/models/main.py | 3 ++- + cola/views/main.py | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/cola/models/main.py b/cola/models/main.py +index b924f45..c155f65 100644 +--- a/cola/models/main.py ++++ b/cola/models/main.py +@@ -139,7 +139,8 @@ class MainModel(ObservableModel): + is_valid = self.git.is_valid() + if is_valid: + self._init_config_data() +- self.set_project(os.path.basename(self.git.worktree())) ++ basename = os.path.basename(self.git.worktree()) ++ self.set_project(core.decode(basename)) + return is_valid + + def _init_config_data(self): +diff --git a/cola/views/main.py b/cola/views/main.py +index d1efbec..0fd1395 100644 +--- a/cola/views/main.py ++++ b/cola/views/main.py +@@ -243,7 +243,7 @@ class MainView(MainWindow): + def _update_callback(self): + """Update the title with the current branch and directory name.""" + branch = self.model.currentbranch +- curdir = os.getcwd() ++ curdir = core.decode(os.getcwd()) + msg = 'Repository: %s\nBranch: %s' % (curdir, branch) + self.commitdockwidget.setToolTip(msg) + +@@ -266,7 +266,7 @@ class MainView(MainWindow): + merge_msg_path = gitcmds.merge_message_path() + if merge_msg_path is None: + return +- merge_msg_hash = utils.checksum(merge_msg_path) ++ merge_msg_hash = utils.checksum(core.decode(merge_msg_path)) + if merge_msg_hash == self.merge_message_hash: + return + self.merge_message_hash = merge_msg_hash +-- +1.7.3.4 + + +From 1db197ca4d7c23587d7adb85704381a8473abacb Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 01:58:41 -0700 +Subject: [PATCH 6/9] bookmarks: Pass '--repo' when launching git-cola on a bookmark + +Otherwise git-cola launches in-place when opening a bookmark. + +Closes #75 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/controllers/bookmark.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/cola/controllers/bookmark.py b/cola/controllers/bookmark.py +index 57cc954..446d852 100644 +--- a/cola/controllers/bookmark.py ++++ b/cola/controllers/bookmark.py +@@ -57,7 +57,7 @@ class BookmarkController(QObserver): + if not selection: + return + for item in selection: +- utils.fork(['git', 'cola', item]) ++ utils.fork([sys.executable, sys.argv[0], '--repo', item]) + + def delete(self): + """Removes a bookmark from the bookmarks list""" +-- +1.7.3.4 + + +From 9b666a5e031e48b76e575ccb756928727beea05e Mon Sep 17 00:00:00 2001 +From: David Aguilar <davvid@gmail.com> +Date: Fri, 15 Apr 2011 02:11:01 -0700 +Subject: [PATCH 7/9] main: Add a '--prompt' option and use it in the desktop launchers + +git-cola assumes that the current directory is a git repository. +This is less helpful when launching git-cola through a launcher icon +because it may find a git repository in $HOME. + +Add a '--prompt' flag and use it in all of the launchers. +This forces git-cola to prompt the user for a repository before +launching the main GUI. + +Closes #75 + +Signed-off-by: David Aguilar <davvid@gmail.com> +--- + cola/main.py | 9 ++++++++- + darwin/git-cola | 2 +- + share/applications/cola.desktop | 2 +- + win32/install.iss | 6 +++--- + 4 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/cola/main.py b/cola/main.py +index 25330f8..e155261 100644 +--- a/cola/main.py ++++ b/cola/main.py +@@ -62,6 +62,13 @@ def main(): + metavar='PATH', + default=os.getcwd()) + ++ # Specifies that we should prompt for a repository at startup ++ parser.add_option('--prompt', ++ help='Prompt for a repository before starting the main GUI.', ++ dest='prompt', ++ action='store_true', ++ default=False) ++ + # Used on Windows for adding 'git' to the path + parser.add_option('-g', '--git-path', + help='Specifies the path to the git binary', +@@ -156,7 +163,7 @@ def main(): + # Ensure that we're working in a valid git repository. + # If not, try to find one. When found, chdir there. + model = cola.model() +- valid = model.use_worktree(repo) ++ valid = model.use_worktree(repo) and not opts.prompt + while not valid: + startup_dlg = startup.StartupDialog(app.activeWindow()) + gitdir = startup_dlg.find_git_repo() +diff --git a/darwin/git-cola b/darwin/git-cola +index 79e5f73..b37575d 100755 +--- a/darwin/git-cola ++++ b/darwin/git-cola +@@ -8,4 +8,4 @@ export PATH + # Contents/Resources + macos="$(dirname "$0")" + contents="$(dirname "$macos")" +-exec python "$contents/Resources/bin/git-cola" ++exec python "$contents/Resources/bin/git-cola" --prompt +diff --git a/share/applications/cola.desktop b/share/applications/cola.desktop +index 44e8d8a..2fdefe0 100644 +--- a/share/applications/cola.desktop ++++ b/share/applications/cola.desktop +@@ -1,7 +1,7 @@ + [Desktop Entry] + Name=Cola Git GUI + Comment=A highly caffeinated git GUI +-Exec=git-cola ++Exec=git-cola --prompt + Icon=/usr/share/git-cola/icons/git.svg + StartupNotify=true + Terminal=false +-- +1.7.3.4 + + +From effa175c909084424c3c49e0ca855d0716a32645 Mon Sep 17 00:00:00 2001 +From: Justin Lecher <jlec@gentoo.org> +Date: Sat, 16 Apr 2011 11:45:12 +0200 +Subject: [PATCH 9/9] Fix for issue 77, Clone doesn't work with --prompt. + +Signed-off-by: Justin Lecher <jlec@gentoo.org> +--- + cola/views/startup.py | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/cola/views/startup.py b/cola/views/startup.py +index 7ec5b6e..a2addd9 100644 +--- a/cola/views/startup.py ++++ b/cola/views/startup.py +@@ -102,7 +102,7 @@ class StartupDialog(QtGui.QDialog): + self.accept() + + def _clone(self): +- gitdir = guicmds.clone_repo(self, spawn=False) ++ gitdir = guicmds.clone_repo(spawn=False) + if gitdir: + self._gitdir = gitdir + self.accept() +-- +1.7.3.4 + diff --git a/dev-vcs/cola/metadata.xml b/dev-vcs/cola/metadata.xml index 78170ac0a566..cd011eef62c4 100644 --- a/dev-vcs/cola/metadata.xml +++ b/dev-vcs/cola/metadata.xml @@ -6,4 +6,8 @@ <email>dev-zero@gentoo.org</email> <name>Tiziano Müller</name> </maintainer> + <maintainer> + <email>jlec@gentoo.org</email> + <name>Justin Lecher</name> + </maintainer> </pkgmetadata> |