[MERGE] enhanced mv command

Martin Pool mbp at canonical.com
Mon Jan 15 08:17:12 GMT 2007


On 12 Jan 2007, John Arbash Meinel <john at arbash-meinel.com> wrote:
> > If you don't like trivial improvements like this even if it is done in an
> > organized fashion,
> > I think the vcs and other tools are failing you.
> > * Something which would be useful for me is to have a gui annotate, which
> > could
> >   drill down when you click on a line: Say the line's revisoin is 10, do a
> > 'bzr annotate -r9'.
> >   I.e re-annotate up to a revision before its current last change.
> 
> Well, we already have:
> 
> % bzr annotate -rX
> # See the last-modified revision == Y
> % bzr annotate -rbefore:Y
> 
> rinse and repeat
> 
> It might be nice to have that as a possibility for gannotate. It would
> be *really* slick if it could do it based on change groups, with a
> little triangle to expand a change group to its previous contents. But
> Aaron pointed out why this is actually quite difficult, because of what
> is actually happening to the texts.

> The current problem is that in the 'rio' tests, there is trailing
> whitespace that must be preserved. Though we could escape it to
> something like: '\x20'. I think it is a bigger "bug" that trailing
> whitespace is significant in RIO formats, but that is the way it was
> written.

Yes, it'd be good to click from a changed line to the revision that
changed it, to a list of changed files, then to an annotation of that
revision.

> The reason is how we handle empty values:
>     if value == '':
>         result.append(tag + ': \n')
>     elif '\n' in value:
>         # don't want splitlines behaviour on empty lines
>         val_lines = value.split('\n')
>         result.append(tag + ': ' + val_lines[0].encode('utf-8') + '\n')
>         for line in val_lines[1:]:
>             result.append('\t' + line.encode('utf-8') + '\n')
>     else:
>         result.append(tag + ': ' + value.encode('utf-8') + '\n')
> 
> (I think the first case is actually redundant with the last, but that
> might be okay).

It's not just empty values, you will also get significant trailing
whitespace if the value has trailing whitespace, or any blank lines.
This is a bit of a shortcoming I suppose, though always escaping it has
other costs.

Still I agree that having significant trailing whitespace in quoted
strings in our source code does make it a bit fragile for people who want
to automatically clean it up, so I will escape them to \x20.

-- 
Martin



More information about the bazaar mailing list