bzr diff -r 10..20 http://foo" unsupported

Bug #6700 reported by Martin Pool
12
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Ian Clatworthy

Bug Description

bzr diff can't show the diff between a range of revisions against a remote repository. It tries to open it as a WorkingTree, which is not supported.

It probably shouldn't try to open a WorkingTree unless it's actually going to diff against the current working copy.

James Blackwell (jblack)
Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pool (mbp) wrote : Re: "bzr diff -r 10..20 http://foo" unsupported

Robert says: there's already a helper function in builtins which will take care of opening either the branch or the directory, depending on whether there is a branch or not. (Or at least there should be such a thing, or it can be extracted from cmd_log?)

Revision history for this message
Jules Bean (jules) wrote :

It's not just http, either. The same problem affects you if you have a non-working tree repository accessed by any method. Since 'bzr push' creates non-working-tree repositories this is quite annoying.

Diff between two versions clearly shouldn't need a working tree to operate.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Jules, I undo your change of the title otherwise just reading the title makes the bug looks strange.

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

There are a large number of Use Cases here I can imagine we want to support. We may not implement all of those immediately but I'd like to ensure we're agreed on an interface that is both easy-to-love and scalable. As I see it, we need the power to:

* compare pretty much any combination of working tree, branch revision, another working tree, anther branch revision
* optionally filter by a list of file and directory names.

Looking at SVN's diff command (http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.diff.html), it's usage is:

    svn diff [-r N[:M]] [TARGET[@REV]...]
    svn diff [-r N[:M]] --old OLD-TGT[@OLDREV] [--new NEW-TGT[@NEWREV]] [PATH...]
    svn diff OLD-URL[@OLDREV] NEW-URL[@NEWREV]

And here's the usage for git-diff (http://www.kernel.org/pub/software/scm/git/docs/git-diff.html):

    git-diff [<common diff options>] <commit>{0,2} [--] [<path>…]

I prefer the git approach of tree/branch URLs on the command line (as opposed to --old and --new + special cases) but suggest they go after the file list. Here's the proposed usage:

  bzr diff [FILE...] [FROM_LOCATION] [TO_LOCATION]

The full text of the proposed help including examples is attached.

Revision history for this message
Martin Pool (mbp) wrote :

I think I'd rather just take the git syntax, including the -- separator. Why?

You can usefully do a selected file diff without specifying both the paths. If we rely on them being the last two then you cannot do that.

Having just done a diff it might be nice to cursor up and add a filename to filter it. (Not a very strong argument.)

Is there any particular reason to put them at the start?

Changed in bzr:
assignee: nobody → ian-clatworthy
Changed in bzr:
status: Confirmed → Fix Committed
Aaron Bentley (abentley)
Changed in bzr:
milestone: none → 1.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.