Merge lp://staging/~andrea.corbellini/software-properties/fix-621977 into lp://staging/software-properties

Proposed by Andrea Corbellini
Status: Needs review
Proposed branch: lp://staging/~andrea.corbellini/software-properties/fix-621977
Merge into: lp://staging/software-properties
Diff against target: 307 lines (+44/-40)
2 files modified
add-apt-repository (+13/-10)
softwareproperties/SoftwareProperties.py (+31/-30)
To merge this branch: bzr merge lp://staging/~andrea.corbellini/software-properties/fix-621977
Reviewer Review Type Date Requested Status
Andrea Corbellini (community) Needs Resubmitting
Barry Warsaw (community) Needs Fixing
Robert Roth (community) Approve
Review via email: mp+134815@code.staging.launchpad.net

Description of the change

This branch fixes bug #621977 in the following way:

1. deb-src lines are added, but commented out, so that Software Properties still lets you enable them later;

2. a new -s, --enable-source command line option is added so that you can add uncommented deb-src line with a single command.

To post a comment you must log in.
Revision history for this message
Robert Roth (evfool) wrote :

The patch looks fine with one minor detail: lots of unchanged lines are added to the diff (probably because tab/spaces usage - whitespace differences). It would be nice if you could set up your editor to use spaces instead of tabs (I think software-properties uses spaces instead of tabs) to avoid harder-to-review diffs, because the reviewer has to filter the real changes.

Other than that: nice solution to comment the source line by default, but leave an option to enable the source with the same command.

review: Approve
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

> The patch looks fine with one minor detail: lots of unchanged lines are added
> to the diff (probably because tab/spaces usage - whitespace differences). It
> would be nice if you could set up your editor to use spaces instead of tabs (I
> think software-properties uses spaces instead of tabs) to avoid harder-to-
> review diffs, because the reviewer has to filter the real changes.

Actually I'm using spaces for indentation. The problem with the diff is caused by the fact that my editor automatically removes trailing whitespace characters. Anyhow, sorry about that :-)

> Other than that: nice solution to comment the source line by default, but
> leave an option to enable the source with the same command.

Thanks!

Revision history for this message
Barry Warsaw (barry) wrote :

The diff looks fine, and while the whitespace cleanups are distracting, I personally appreciate all that trailing whitespace not hurting my eyes :)

I'll go ahead and sponsor this into Raring. Thanks for your contribution to Ubuntu!

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

Whoops, this causes some test failures. I think they're shallow -- let's see.

Revision history for this message
Barry Warsaw (barry) wrote :

1 failure, 1 error:

======================================================================
ERROR: test_add_remove_source_by_line (__main__.TestDBus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_dbus.py", line 248, in test_add_remove_source_by_line
    self.iface.RemoveSource(s.replace("deb", "deb-src"))
  File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "../softwareproperties/dbus/SoftwarePropertiesDBus.py", line 278, in RemoveSource
    self.remove_source(_to_unicode(source))
  File "../softwareproperties/SoftwareProperties.py", line 741, in remove_source
    if source.file != apt_pkg.config.find_file("Dir::Etc::sourcelist"):
AttributeError: 'NoneType' object has no attribute 'file'

======================================================================
FAIL: test_enable_enable_disable_source_code_sources (__main__.TestDBus)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_dbus.py", line 127, in test_enable_enable_disable_source_code_sources
    self.assertFalse("deb-src" in sourceslist)
AssertionError: True is not false

So I think before this is merged you have to decide how to handle this. Marking this Needs Fixing for now.

review: Needs Fixing
Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :
review: Needs Resubmitting

Unmerged revisions

822. By Andrea Corbellini

Do not enable deb-src lines by default.

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 status/vote changes: