summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-08-31Add utility for constant-response cachingOwen W. Taylor
We don't want to constantly refetch things like legal field values from the server. Add a simple cache based on RawConfigParser and pickled values stored in ~/.git-bz-cache.
2009-08-31Add push subcommand to help commandOwen W. Taylor
When listing the available commands, include 'push'
2009-08-31Fix checking for missing fields in XML responseOwen W. Taylor
token = bug.find("token") self.token = token.text if token else None Was behaving strangely: apparently ElementTree can be logically false when non-None. Switch to the more explicit: self.token = None if token is None else token.text
2009-08-30Fix marking patches as obsolete from 'git bz edit'Owen W. Taylor
Field value for isobsolete must be string "1" not 1.
2009-08-30Fix git-bz to work with none-GNOME bugzillaOwen W. Taylor
* Catch the server returning a 500 protocol error on xmlrpc.cgi; this happens with bugzilla.openedhand.com and probably other older versions of post 3.0 bugzilla. * Handle the server not sending bug/attachment tokens * Make patch-status handling conditional on the server having status on patches.
2009-08-30Add 'git bz edit --pushed' and 'git bz push'Owen W. Taylor
'git bz edit --pushed <commits>' automatically prepares the bug editing buffering based on a guess as what edits (comments, resolving the bug, changing attachment status) are appropriate once the commits are pushed to the project's official repository. 'git bz push' actually pushes commits and then does 'git bz edit --pushed'
2009-08-30Allow capturing stderr from a run git commandOwen W. Taylor
If _return_error=True is added to git.<command_name>() then a tuple of captured output from stderr, stdout is returned. We'll need this to parse the output of 'git push' which goes to stderr.
2009-08-30Allow passing a commit or revision range to 'git bz edit'Owen W. Taylor
If a commit or revision range is passed to 'git bz edit', make it edit all the bugs referenced in the commit or commits.
2009-08-30Add a BugHandle class to represent parsed bug referencesOwen W. Taylor
Instead of using (host, https, id) tuples, encapsulate the information in a BugHandle class. Add get_bug_server() method to look up a server for a (host, https) pair; we uniquify the server across multiple lookups; this will be useful if we edit multiple bugs in a single run.
2009-08-30Add an edit subcommandOwen W. Taylor
git bz edit <bug reference> Allows doing common operations on a Bugzilla bug without going to your web browser. An editable buffer is brought up in a git-like fashion, where you can add comments, resolve a bug, and change the status of patches. This is really a warm-up for 'git bz push' which will do a semi-automatic job of figuring out all the appropriate edits that need to be made when pushing a set of commits that are annotated with bug references.
2009-08-30Add a method for getting legal field valuesOwen W. Taylor
Add Bug.legal_values() to query the server via XML-RPC to find out legal values for a particular field.
2009-08-30Add a method to update a patch on a bugOwen W. Taylor
Add Bug.update_patch() to allow changing fields of an existing attachment (status, isobsolete, etc.) This requires saving all the fields when parsing them out of the bug XML, since we have to pass them back to attachment.cgi.
2009-08-30Add a method to update a bugOwen W. Taylor
Add Bug.update() to allow changing fields in an existing bug. (adding comments, setting the status/resolution, etc.)
2009-08-30Add helper functions for handling abbrevationsOwen W. Taylor
abbreviation_help_string(['apple', 'pear', 'potato']) => '[a]pple, [pe]ar, [po]tato' expand_abbreviation('pea', ['apple', 'pear', 'potato']) => 'pear'
2009-08-30Add a helper function for checking for successOwen W. Taylor
Encapsulate the process of grepping through successful (200) responses from Bugzilla to see if they were *really* successful in a function.
2009-08-29Allow files=None for BugServer.send_post()Owen W. Taylor
We only want to pass in a non-None files in one place, so allow files=None to be the same as {}.
2009-08-29File bugs via XML-RPC when possibleOwen W. Taylor
If the server supports XML-RPC (3.0 or newer), then filing via xmlrpc.cgi has advantages: - We get a string error message instead of an HTML page - We can not specify priority/severity and let the server default it; this is important since there aren't standard priorities. So, we try to first file via xmlrpc.cgi's Bug.create method and if we get a 404, fall back to the old method of a form post. The configuration for a couple of fields is changed to use the human readable field names from Bug.create rather than the database-field names of post_bug.cgi. default-bug-severity => default-severity default-rep-platform => default-platform
2009-08-29Split HTTP communication out of Bug classOwen W. Taylor
Create a separate BugServer class that represents a Bugzilla server instance and has send_request()/send_post() methods.
2009-08-29Fix error message when not logged inOwen W. Taylor
A string with unsubstituted %s was being printed; substitute in the host and browser properly. Pointed out by Jonathon Jongsma
2009-08-29Improve error handling when bug reference is incorrectJonathon Jongsma
If the user specifies the bug url on the command line but the url violates our assumptions, git-bz doesn't currently handle it well. For instance, the following commandline invocation: git bz attach http://bugzilla.foo.org HEAD will fail the regex that checks whether it is a bugzilla url (since it is missing show_bug.cgi), so it will interpret it as a 'alias:1234'-style reference. 'http' is interpreted as the alias, but when that is not found in the git config, it will attempt to look up a browser cookie for the host 'http'. That will also fail, but it will report a misleading error which is something like: Please log in to 'http' in Firefox This patch just does a little sanity checking that the bug id is a number and aborts with a slightly more helpful error message if that is not true.
2009-08-24Fix to work again with FirefoxOwen W. Taylor
The version of Colin's Chromium patch I applied was outdated and had an obvious left-over in the Xulrunner codepaths that made things no longer with with Firefox and Epiphany. Fix.
2009-08-24Support chromium cookiesColin Walters
Chromium uses sqlite for cookies as well and with a very similar (but not identical) schema compared to xulrunner. Abstract things a bit so that chromium can use most of the same code.
2009-08-24Get attachment data from XML bug dump instead of downloading separatelyOwen W. Taylor
All of the bugtrackers we care about (gnome,mozilla,freedesktop,openedhand), include attachment data in the ctype=xml output, so: - Use excludefield=attachmentdata when we don't want attachment data - Use the data downloaded with the XML data when we do want attachment data (git bz apply) rather than downloading it separately. This fixes problems with bugzilla servers that use a redirect for attachments.
2009-08-15Fix to work with Bugzilla 3.4Owen W. Taylor
Bugzilla 3.4 (like the new GNOME bugzilla) - Requires a status for attached patches - Uses a different title for succesful attachments
2009-06-25Pass -M to git-format-patchOwen W. Taylor
Passing -M to git-format-patch when creating patches means that renames will be shown as renames, increasing reviewability of the resulting patches.
2009-04-25Make 'git bz file <commit>' just file that commitOwen W. Taylor
Deviate from git-format-patch in the handling of a single revision: file a bug with a single patch is definitely more common than filing a bug with a range of patches and this results in less mystical invocations. Hopefully git-format-patch will eventually catch up. Remove the support for --num=<N> and -N since it's minimally useful now; it's not impossible to want to do 'git bz file old_commit^.. -2' but I don't want to clutter the interface.
2009-04-25Move default-product and default-component to main bz sectionOwen W. Taylor
Picking up product and component from the tracker specific config was never useful and annoying; move the options bz.default-product and bz.default-component. Display useful help when product/component aren't specified. (No concession to backwards-compat here: people can easily reconfigure, especially with the help.)
2009-04-25Work around Firefox-3.5 locking problems with a copyOwen W. Taylor
Firefox-3.5 seems to always hold cookies.sqlite locked while the browser is open. Work around this by, when we hit a lock error, making a copy and reading from that. Not 100% reliable, but should work much of the time.
2009-04-25Factor out common code between Firefox and Epiphany cookie readingOwen W. Taylor
Make both call a common get_cookies_from_sqlite() to avoid code duplication. Return errors by raising a CookieError so that we can centralize information about git-config bz.browser into one place.
2009-04-25Add support for epiphany as wellAndy Wingo
Add bugzilla support for epiphany. Enable via: git config --global bz.browser epiphany Switch back via: git config --global bz.browser firefox3
2009-04-25Add checks to try and detect when -u/--add-url won't workOwen W. Taylor
Check for: - Commits already pushed to a remote branch - Commits that aren't on the current branch - Merge commits
2008-12-04Add TODO item - Automatically guess obvious obsoletesOwen W. Taylor
2008-12-04Add TODO itemsOwen W. Taylor
Allow omitting bug reference when obvious Default to -e/--edit when only one commit
2008-12-03Allow a separate description for git bz fileOwen W. Taylor
Only use the commit body as the bug description when filing a new bug if no other description is specified; if another description is entered, use the commit body as the description for the attachment.
2008-12-03Skip prompting about attachments when editing commentOwen W. Taylor
If -e/--edit is specified and there is only one patch, go straight to the edit, the user can abort from there if necessary.
2008-12-03Allow editing attachment comment and obsoletesOwen W. Taylor
Add a -e/--edit option to 'git-bz-attach' to bring up the description/comment in an editor. Existing patches are shown as commented out Obsoletes: lines that can be uncommented to to obsolete the old patches.
2008-11-23Fix resolving URL bug referencesOwen W. Taylor
Fix a problem where https was always used when a bug reference was specified as an URL: fhttp(s?) gives a group(1) of "" not None when the s is missing
2008-11-22Improve documentation of aliases and configurationOwen W. Taylor
Switch the example alias from the 'bgo' to the less obscure 'gnome'. (Suggestion from Ray Strode.) Other minor tweaks to the docs.
2008-11-22Allowing configuring a default product and componentOwen W. Taylor
Allowing specifying bz-tracker.<tracker>.default-product and bz-tracker.<tracker>.default-component. This is useful when done in the per-repository config. Add a "Per-repository configuration" section in the docs with examples.
2008-11-22Make -b/--bugzilla a global optionOwen W. Taylor
Allow specifying -b/--bugzilla for all subcommands and not just for for 'file'
2008-11-22Add TODO item: Reconsider initial description for 'git bz file'Owen W. Taylor
2008-11-22Allow spaces in products and componentsOwen W. Taylor
While spaces in products and components may not be common, bugzilla.openedhand.com has, for example, "Metacity (Clutter port)" as a product. So allow that.
2008-11-20Minor indentation tweakOwen W. Taylor
Tweak style from last patch to match personal preference.
2008-11-20Make firefox profile lookup more relaxedTommi Komulainen
Select the first profile with a Path entry, and in case of multiple profiles use the one with Default=1 Fixes profile lookup with profiles.ini that looks like: [General] StartWithLastProfile=1 [Profile0] Name=default IsRelative=1 Path=t0ps3cr3t.default
2008-11-19Add TODO item: Specifying a default product/componentOwen W. Taylor
2008-11-19Fix git bz file of the last most recent commitOwen W. Taylor
rev_list_commits() wasn't working properly when the returned list of commits was empty because "".split("\n") is [""] not []. Special case that. (Reported by Colin Walters.)
2008-11-19Remove dependency on GitPythonOwen W. Taylor
Replace usage of random low-level parts of GitPython with a simple convenience functionality similar to that offered by git.cmd. For example: git.commit(file="-", amend=True, _input=input) Include special options _input/_quiet/_interactive to allow removing several cases where subprocess.Popen() was used directly and improve output on git command failure. Also, use commit.subject rather than commit.message to be consistent with standard Git terminology.
2008-11-18Don't include the URL in the attachment commentOwen W. Taylor
Strip out the URL we add with -u when using the body of the commit as the comment for an attachmnet; it's completely redundant to have an URL pointing back to the bug page itself.
2008-11-18Try to catch failure when attaching a patchOwen W. Taylor
If the response to attaching a patch doesn't have "Changes Submitted" as the, assume the attachment failed and dump out an error message and the response body.
2008-11-17Add TODO item: For attach -u don't include URL in the commentOwen W. Taylor