Merge ~nacc/git-ubuntu:make-clone-verbose into git-ubuntu:master

Proposed by Nish Aravamudan
Status: Merged
Approved by: Nish Aravamudan
Approved revision: c8abe3fd4a86c29ba9510e7c5279e14c5fb7bdf4
Merged at revision: 09aadc3667a431b4b4d4933ee04c75a3d061163b
Proposed branch: ~nacc/git-ubuntu:make-clone-verbose
Merge into: git-ubuntu:master
Diff against target: 409 lines (+132/-59)
9 files modified
gitubuntu/__main__.py (+4/-1)
gitubuntu/clone.py (+8/-5)
gitubuntu/git_repository.py (+48/-28)
gitubuntu/importer.py (+18/-5)
gitubuntu/importppa.py (+8/-2)
gitubuntu/merge.py (+13/-5)
gitubuntu/queue.py (+12/-2)
gitubuntu/remote.py (+9/-2)
gitubuntu/run.py (+12/-9)
Reviewer Review Type Date Requested Status
Robie Basak Approve
Review via email: mp+328536@code.staging.launchpad.net

This proposal supersedes a proposal from 2017-08-02.

Description of the change

Pattern rethought after review feedback.

Resubmitting as the code is pretty dramatically different (but more well-tested now).

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote : Posted in a previous version of this proposal

I agree in principle, although it feels to me that we should stick to either "verbose" or "quiet" but not both (so I suggest "verbose" as we've used that elsewhere), and that they should be independent of must_exist. So no magic of the defaulting or setting of one based on the other - leave that to the caller.

That's my gut feel, without having looked or thought deeper.

Revision history for this message
Robie Basak (racb) : Posted in a previous version of this proposal
Revision history for this message
Nish Aravamudan (nacc) wrote : Posted in a previous version of this proposal

On Tue, Aug 1, 2017 at 2:39 PM, Robie Basak <email address hidden> wrote:
>
>
> Diff comments:
>
>> diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
>> index ba0480b..fb7179b 100644
>> --- a/gitubuntu/git_repository.py
>> +++ b/gitubuntu/git_repository.py
>> @@ -265,12 +265,17 @@ class GitUbuntuRepository:
>> # XXX: want a remote alias of 'lpme' -> self.lp_user
>> # self.git_run(['config', 'url.%s.insteadof' % self.lp_user, 'lpme'])
>>
>> - def _fetch_remote(self, remote_name, must_exist):
>> + def fetch_remote(self, remote_name, must_exist, quiet=True):
>> try:
>> # Does not seem to be working with https
>> # self.raw_repo.remotes[remote_name].fetch()
>> logging.debug('Fetching remote %s' % remote_name)
>> - self.git_run(['fetch', remote_name], quiet=not must_exist)
>> + kwargs = {}
>> + kwargs['quiet'] = not must_exist
>
> This is the magic crossing of the two concepts that I think is a little surprising and should be left to the caller instead.

100% agree :) hence the glance, as you tend to be able to think a bit
faster about best design in Python.

I'll adjust and resubmit later this week.

Revision history for this message
Robie Basak (racb) wrote : Posted in a previous version of this proposal

Looks good! One minor style comment inline.

review: Approve
Revision history for this message
Nish Aravamudan (nacc) wrote : Posted in a previous version of this proposal

Thanks, I found some practical errors and forgot to update queue. Will send
a new MP tomorrow.

On Aug 2, 2017 16:49, "Robie Basak" <email address hidden> wrote:

> Review: Approve
>
> Looks good! One minor style comment inline.
>
> Diff comments:
>
> > diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
> > index 9f466c9..bbfc3b5 100644
> > --- a/gitubuntu/importer.py
> > +++ b/gitubuntu/importer.py
> > @@ -37,7 +37,7 @@ import tempfile
> > import time
> > from gitubuntu.cache import CACHE_PATH
> > from gitubuntu.dsc import GitUbuntuDsc
> > -from gitubuntu.git_repository import GitUbuntuRepository, orphan_tag,
> applied_tag, import_tag, upstream_tag
> > +from gitubuntu.git_repository import GitUbuntuRepository,
> GitUbuntuRepositoryFetchError, orphan_tag, applied_tag, import_tag,
> upstream_tag
>
> Going >79 here? If so, I think we can do:
>
> from gitubuntu.git_respository import (
> a,
> b,
> c,
> )
>
> I could be wrong about the exact syntax, but I believe something along
> these lines is possible.
>
> > from gitubuntu.run import decode_binary, run, runq
> > from gitubuntu.source_information import GitUbuntuSourceInformation,
> NoPublicationHistoryException, SourceExtractionException,
> launchpad_login_auth
> > from gitubuntu.version import VERSION
>
>
> --
> https://code.launchpad.net/~nacc/usd-importer/+git/usd-
> importer/+merge/328486
> You are the owner of ~nacc/usd-importer:make-clone-verbose.
>

Revision history for this message
Robie Basak (racb) wrote :

Reminder: audit function calls for trailing comma on multi-line function calls. I think there was one instance of no newline after an opening multi-line [. Happy to skip for now if this holds something up.

review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

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