On Tue, May 15, 2012 at 05:42:18PM +0200, Daniel Dehennin wrote: > Guido Günther <a...@sigxcpu.org> writes: > > > [...] > > >> + cp = klass(filename="debian/changelog") > >> + cp.first = True > >> + return cp > > > > It's better to have a: > > > > cp.is_empty() > > > > method here. You can simply stat the file and check it's length to > > implement this until we have the ChangeLog class parsing the changelog > > for real. > > Actually a ChangeLog instance can not represent an empty > debian/changelog, that's the reason of ChangeLog.create().
We could certainly change that. > But after ChangeLog.create(), the debian/changelog is not empty anymore > and we must take care that > > since = repo.find_version(options.debian_tag, cp['Version']) > > will never work in the case of a truly new package. > > If the changelog was removed, using > > since = guess_snapshot_commit(cp, repo, options) > > will do the work. > > I agree we need to get the state of the changelog, either preexistant or > newly created by ChangeLog.create(), I just wonder what is the good way > to do it (and to name whatever attribute/method). Just count the number of sections in the changelog. I've pushed some code that should make this really easy. We can also extend changelog parsing/writing from there. Cheers, -- Guido > > Regards. > > -- > Daniel Dehennin > Récupérer ma clef GPG: > gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org