summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix subcommands without --add-url optionOwen W. Taylor2009-09-181-1/+1
| | | | | 'git bz add-url' was dying because the code was expecting all subcommands to have an --add-url option but add-url doesn't.
* Fix adding-url to just some commitsOwen W. Taylor2009-09-181-28/+27
| | | | | Adding an URL to just some commits was broken in the rewrite to be more like git rebase, shuffle things around to fix that.
* Mark bugzilla.gnome.org as httpsOwen W. Taylor2009-09-091-0/+1
| | | | | | bugzilla.gnome.org now supports and redirects to https; even though we handle the redirects, having it as https in the config will save a round trip.
* Handle redirectsOwen W. Taylor2009-09-092-25/+89
| | | | | | | | | | | | | Handle redirect HTTP responses, in particular if a Bugzilla server is redirecting from http to https. We try to detect "Bugzilla URL base is over here" when we ask for show_bug.cgi and remember that for future requests to the same BugServer to avoid too many redirections. Switch from caching connection on the BugServer to a global connection cache, and rewrite the BugServer cache so to deal with the possibility of redirections.
* Avoid Python2.6-ismsEmmanuele Bassi2009-09-091-2/+4
| | | | | | | | | | | | | | | I'm not entirely up to speed with the new syntax of Python 2.6, but apparently you can now do: func(*args, named_arg=value, **options) and: func(*args, named_arg=value) and Python will happily coalesce named_arg into **options for you. This is not a valid syntax for Python 2.5, though.
* Add 'git bz push -fix' and 'git bz edit --fix'Owen W. Taylor2009-09-052-47/+115
| | | | | | Add one-stop-shopping --fix=<bug reference> options to 'git bz push' and 'git bz edit'. These combine attaching the patches and resolving the bug for cases where review and testing aren't necessary.
* Make 'git bz add-url' more like git rebaseOwen W. Taylor2009-09-052-21/+25
| | | | | | | | | Instead of resetting the branch and applying the patches there, move to a detached HEAD, apply patches to the detached HEAD and then make a single update to the branch ref. The only real advantage of this is that 'git reflog show <branchname>' shows a single meaningful commit.
* TODO updatesOwen W. Taylor2009-09-051-3/+48
| | | | | | - Always do 'git bz attach --edit' - Apply patches as a single mailbox - Make -u/--add-url kinder on the reflog
* Split out documentationOwen W. Taylor2009-09-055-201/+396
| | | | | | | | | | Move the documentation from a giant comment at the start of the file into a separate asciidoc document. Among other revisions an 'EXAMPLE SESSION' section is added to give a sense of the normal workflow. Add a Makefile and asciidoc.conf for converting the asciidoc into HTML or a man page.
* Command line option tweaksOwen W. Taylor2009-09-051-7/+8
| | | | | | | | | | | - Remove the -p shortcut for 'git bz edit --pushed' - I don't find it sufficiently mnemonic to be worth confusion with things like 'git add -p'. - Say -n/--no-add-url instead of just --no-add-url in an error message. - Fix usage messages to consistently use () for grouping and [] for optional parts.
* Allow omitting bug reference for 'git bz attach'Owen W. Taylor2009-09-052-10/+31
| | | | | When there is a single bug referenced in the commits being attached, allow using that instead of specifying a bug reference manually.
* Make --add-url the default for 'git bz apply' as wellOwen W. Taylor2009-09-041-2/+2
| | | | | | 1) It's confusing to have it different 2) For git bz push, we want to have that association whenever possible, even if you didn't create the patch yourself.
* Ignore committed/rejected patchesOwen W. Taylor2009-09-041-0/+4
| | | | | If patches have a status and it's 'committed' or 'rejected', then skip them for git-bz apply and don't prompt.
* Allow configuring bug reference additionOwen W. Taylor2009-09-011-11/+101
| | | | | | | Allow configuring the behavior of add-url and --add-url with the bz.add-url-method config variable. For example: git config bz.add-url-method subject-prepend:Bug %d -
* Improve URL additionOwen W. Taylor2009-09-011-9/+23
| | | | | | | | | | | * Avoid false positives when the bug # is a substring of a number in the commit. * Look at the header, not just the body, for an existing bug # * When there are local changes, don't print the diffs to the the screen. * For 'git bz add-url' indicate what commits we are skipping, and don't prompt if we aren't going to do anything. * Don't start the rebase procedure if we aren't going to do anything.
* Add URLs by defaultOwen W. Taylor2009-09-011-15/+28
| | | | | | Switch the default for 'git bz file' and 'git bz attach' so that they automatically add the URL to the commit message. Add -n/--no-add-url options to disable adding the URL.
* Make bug changes before attachment changes to avoid token problemsOwen W. Taylor2009-08-311-10/+17
| | | | | | | If we make attachment changes first, we change the timestamp of the bug; rather than refetching a new token for the bug (or parsing it out of the HTML response), we just make the bug changes first and the attachment changes second.
* Use .add() for sets not .append()Owen W. Taylor2009-08-311-1/+1
| | | | Fix a problem with adding patches to the 'unapplied_patches' set.
* Cache legal field valuesOwen W. Taylor2009-08-311-19/+28
| | | | | | | | | Use our constant-field-value cache to cache legal field values for each server; this cuts round trips for 'git bz edit' from 3 to 1, which is quite noticeably faster. The legal_values method is moved from Bug to BugServer, where it makes more sense.
* Add utility for constant-response cachingOwen W. Taylor2009-08-311-1/+40
| | | | | | 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.
* Add push subcommand to help commandOwen W. Taylor2009-08-311-1/+1
| | | | When listing the available commands, include 'push'
* Fix checking for missing fields in XML responseOwen W. Taylor2009-08-311-3/+3
| | | | | | | | | | 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
* Fix marking patches as obsolete from 'git bz edit'Owen W. Taylor2009-08-301-1/+1
| | | | Field value for isobsolete must be string "1" not 1.
* Fix git-bz to work with none-GNOME bugzillaOwen W. Taylor2009-08-301-29/+53
| | | | | | | | | | | * 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.
* Add 'git bz edit --pushed' and 'git bz push'Owen W. Taylor2009-08-301-8/+143
| | | | | | | | | | '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'
* Allow capturing stderr from a run git commandOwen W. Taylor2009-08-301-0/+6
| | | | | | 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.
* Allow passing a commit or revision range to 'git bz edit'Owen W. Taylor2009-08-301-5/+82
| | | | | If a commit or revision range is passed to 'git bz edit', make it edit all the bugs referenced in the commit or commits.
* Add a BugHandle class to represent parsed bug referencesOwen W. Taylor2009-08-301-28/+63
| | | | | | | | | 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.
* Add an edit subcommandOwen W. Taylor2009-08-301-1/+118
| | | | | | | | | | | | | | 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.
* Add a method for getting legal field valuesOwen W. Taylor2009-08-301-0/+15
| | | | | Add Bug.legal_values() to query the server via XML-RPC to find out legal values for a particular field.
* Add a method to update a patch on a bugOwen W. Taylor2009-08-301-9/+49
| | | | | | | | 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.
* Add a method to update a bugOwen W. Taylor2009-08-301-0/+19
| | | | | Add Bug.update() to allow changing fields in an existing bug. (adding comments, setting the status/resolution, etc.)
* Add helper functions for handling abbrevationsOwen W. Taylor2009-08-301-0/+23
| | | | | | | | abbreviation_help_string(['apple', 'pear', 'potato']) => '[a]pple, [pe]ar, [po]tato' expand_abbreviation('pea', ['apple', 'pear', 'potato']) => 'pear'
* Add a helper function for checking for successOwen W. Taylor2009-08-301-18/+33
| | | | | | Encapsulate the process of grepping through successful (200) responses from Bugzilla to see if they were *really* successful in a function.
* Allow files=None for BugServer.send_post()Owen W. Taylor2009-08-291-14/+12
| | | | | We only want to pass in a non-None files in one place, so allow files=None to be the same as {}.
* File bugs via XML-RPC when possibleOwen W. Taylor2009-08-292-20/+89
| | | | | | | | | | | | | | | | | | | | 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
* Split HTTP communication out of Bug classOwen W. Taylor2009-08-291-31/+40
| | | | | Create a separate BugServer class that represents a Bugzilla server instance and has send_request()/send_post() methods.
* Fix error message when not logged inOwen W. Taylor2009-08-291-4/+5
| | | | | | | A string with unsubstituted %s was being printed; substitute in the host and browser properly. Pointed out by Jonathon Jongsma
* Improve error handling when bug reference is incorrectJonathon Jongsma2009-08-291-0/+3
| | | | | | | | | | | | | | | | | | | 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.
* Fix to work again with FirefoxOwen W. Taylor2009-08-241-2/+2
| | | | | | 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.
* Support chromium cookiesColin Walters2009-08-241-10/+23
| | | | | | 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.
* Get attachment data from XML bug dump instead of downloading separatelyOwen W. Taylor2009-08-241-17/+18
| | | | | | | | | | | 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.
* Fix to work with Bugzilla 3.4Owen W. Taylor2009-08-151-2/+5
| | | | | | | Bugzilla 3.4 (like the new GNOME bugzilla) - Requires a status for attached patches - Uses a different title for succesful attachments
* Pass -M to git-format-patchOwen W. Taylor2009-06-251-1/+4
| | | | | | Passing -M to git-format-patch when creating patches means that renames will be shown as renames, increasing reviewability of the resulting patches.
* Make 'git bz file <commit>' just file that commitOwen W. Taylor2009-04-251-50/+35
| | | | | | | | | | | 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.
* Move default-product and default-component to main bz sectionOwen W. Taylor2009-04-251-18/+45
| | | | | | | | | | | 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.)
* Work around Firefox-3.5 locking problems with a copyOwen W. Taylor2009-04-251-10/+40
| | | | | | | 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.
* Factor out common code between Firefox and Epiphany cookie readingOwen W. Taylor2009-04-251-46/+44
| | | | | | 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.
* Add support for epiphany as wellAndy Wingo2009-04-251-7/+52
| | | | | | | | | | Add bugzilla support for epiphany. Enable via: git config --global bz.browser epiphany Switch back via: git config --global bz.browser firefox3
* Add checks to try and detect when -u/--add-url won't workOwen W. Taylor2009-04-251-10/+59
| | | | | | | Check for: - Commits already pushed to a remote branch - Commits that aren't on the current branch - Merge commits