Guido Günther <[email protected]> writes:
[...]
>> - # FIXME: When creating a new package: find merge base
>> between HEAD and origin
>> - since = repo.find_version(options.debian_tag, cp['Version'])
>> + # Take care of newly created debian/changelog
>> + if hasattr(cp, 'first') and cp.first:
>
> Hmm...where is first being set? I cloned
>
> git://git.baby-gnu.org/git-buildpackage
> tags/dad/create-inexistant-changelog/rebasable/on-f495df9-1
>
> and couldn't find it at a first glance.
I did it in gbp.deb.Changelog.create.
I was thinking about adding a "first=Fales" parameter to
Changelog.__init__ and make Changelog.create using True.
But this seems to be a "private" attribute, I don't like the idea of
exposing it in __init__ signature.
Maybe doing "self._first = False" in Changelog.__init__ and
Changelog.create set it to True is a better idea, no need call hasattr.
>
>
>> + pattern = options.upstream_tag % dict(version='*')
>> + try:
>> + upstream = repo.find_tag('HEAD', pattern=pattern)
>> + except GitRepositoryError:
>> + gbp.debug('No upstream tag found')
>> + upstream = options.upstream_branch
>> + if options.upstream_tree == 'branch':
>> + upstream = options.upstream_branch
>> + since = repo.get_merge_base('HEAD', upstream)
>
> Need to catch exception if no merge base is found.
I'm not sure, if we don't find a merge base there is nothing we can do.
The user may set a wrong upstream-branch name in its gbp.conf, I think
the most significant thing to do is to report the
"GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object
name XXXX"
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF
pgphf8NTytRol.pgp
Description: PGP signature

