On Mon, 2010-09-13 at 18:04 +0200, Frank Becker wrote:
> John Admanski [2010-09-13, 17:43 +0200]:
> > On Mon, Sep 13, 2010 at 8:26 AM, Frank Becker <[email protected]> wrote:
> > 
> > > John Admanski [2010-09-13, 16:44 +0200]:
> 
> Hi,
> 
> [...]
> > > > > +            branch = [b.lstrip('* ') for b in
> > > gitlog.stdout.split('\n') \
> > > > > +                      if b.startswith('*')][0]
> > > > > +            return branch
> > > That's the line we talk about. I'd like to strip off the two 1st 
> > > characters
> > > '* '. b[2:] would be equivalent.
> > Yeah, if the idea is to find the branch by looking for a line that starts
> > with '* ' then it's probably better to write it as:
> > 
> > branch = [b[2:] for b in gitlog.stdout.split('\n') if b.startswith('* ')][0]
> Right, that is the better solution. I'll send a patch to fix that tomorrow.
> Don't have access to the repo right now.

All right Frank, I am going to commit this patchset, you send a patch to
fix the get_branch code, and I'll prepare later the patchset to move the
git handling class to a common_lib library. I am envisioning something
called source_control, that contains classes to abstract interaction
with any revision control systems people are interested in.

from autotest_lib.client.common_lib import source_control

git_repo = source_control.GitRepo(...

Cheers,

Lucas

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to