[MERGE] Prepare iter_lines... for reconcile.

Ian Clatworthy ian.clatworthy at internode.on.net
Tue Nov 13 01:21:40 GMT 2007


Robert Collins wrote:
> This changes (without backwards compatibility) the
> iter_lines_added_or_present_in_versions VersionedFile API to yield the
> text version that each line is being returned from. This is useful for
> reconcile in determining what inventories reference what texts.

bb: tweak

A few things need tweaking here ...

1. While this is a low level API, it is public and therefore it needs a
   NEWS entry mentioning the compatibility break.

2. The docstring in versionedfile.py needs to be corrected/updated.

A minor suggestion as well ...

>                      else:
>                          line_iterator = factory.get_linedelta_content(content)
>                      for line in line_iterator:
> -                        yield line
> +                        yield line, key[-1]
>                  else:
>                      # check the header only
>                      df, _ = knit_data._parse_record_header(key[-1], raw_data)

key[-1] is referenced 3 or more times in that for loop so I think it
would improve readability if "version_id = key[-1]" was added need the
top of the loop and version_id was used in place of key[-1].

Ian C.



More information about the bazaar mailing list