[merge] Fix trailing whitespace bug #49182

Aaron Bentley aaron.bentley at utoronto.ca
Thu Jun 22 20:42:28 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Arbash Meinel wrote:
> I've gotten bit by this several times, and it seems other people have as
> well. So I went ahead and wrote this patch which tests bundles that have
> their trailing whitespace messed with, and fixes the parser.

Great.  +1.

> The selftests pass, though for some reason I'm getting tracebacks in the
> SFTP Server threads. 'Broken pipe' mostly. But I'm getting those in
> plain 'bzr.dev', so it shouldn't be anything with my patch.

Those seem to have come in with Robey's recent SFTP timeout fix.

>      def _read_revision_header(self):
> +        found_something = False
>          self.info.revisions.append(RevisionInfo(None))
>          for line in self._next():
>              # The bzr header is terminated with a blank line
>              # which does not start with '#'
>              if line is None or line == '\n':
>                  break
> +            found_something = True
>              self._handle_next(line)
> +        if not found_something:
> +            # Nothing was there, so remove the added revision
> +            self.info.revisions.pop()
> +        return found_something

It would be nice if revisions were added after they were filled in.
Then this method would be exception-safe.  But not a showstopper.  I
seem to recall we used self.info.revisions[-1] in a bunch of places.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEmvKk0F+nu1YWqI0RAsTDAJ0RAq87ldU5URNds1TO6HyVIwxhGgCfcIvi
ccl+GpHrzDGlyn8jKoKW5Pw=
=F8x+
-----END PGP SIGNATURE-----




More information about the bazaar mailing list