Merge lp://staging/~toshio/bzr-gtk/handle-patch-dirty into lp://staging/bzr-gtk/gtk2

Proposed by Toshio Kuratomi
Status: Merged
Merged at revision: 693
Proposed branch: lp://staging/~toshio/bzr-gtk/handle-patch-dirty
Merge into: lp://staging/bzr-gtk/gtk2
Diff against target: 50 lines (+10/-3)
2 files modified
bzr-handle-patch (+1/-1)
diff.py (+9/-2)
To merge this branch: bzr merge lp://staging/~toshio/bzr-gtk/handle-patch-dirty
Reviewer Review Type Date Requested Status
Bazaar GTK maintainers Pending
Review via email: mp+23330@code.staging.launchpad.net

Description of the change

This fixes bzr-handle-patch to not traceback with patches that have leading and trailing comments if a newer bzr (2.2b1 is the first release to support this) is installed. If an older bzr is installed, the code falls back on the old behaviour that handles clean patches but fails on "dirty" ones.

Note: Detection of recent enough bzr uses inspect.getargspec() rather than checking against bzrlib.version_info since
* it seems more pythonic to detect that bzrlib has the necessary parameter than to hardcode versions
* since the change only appears in bzr-2.2b1; downstream distributors are likely to backport the fix. If they do that, a bzrlib.version_info check in bzr-gtk would need to be patched out as well as it would no longer represent the capabilities of that bzrlib.

If you don't like getargspec(), we can substitute::

  if bzrlib.version_info[:2] >= (2, 2, 0, 'b', 1):

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: