Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Given two branches, branchA and branchB, is there a syntax for comparing arbitrary revisions X of branchA with Y of branchB?

For example:

cd /path/to/branchA
bzr diff --new /path/to/branchB -rX

This will show the differences between revision X of branchA and the HEAD of branchB. Is there a syntax to compare against revision Y of branchB instead of the HEAD?

As a workaround I can create a new branch branchB-Y using -rY and then diff against that branch instead of branchB, but I would like to be able to diff directly without creating such temporary branches.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You can specify the path to the branch of the revision by appending a : and the path:

cd /path/to/branchA
bzr diff --new /path/to/branchB -rX..Y:/path/to/branchB

I just tried it out:

$ bzr diff --new ../checkout -r2..2:../checkout
=== modified file 'x'
--- x   2013-03-12 17:28:11 +0000
+++ x   2013-03-12 17:26:47 +0000
@@ -1,1 +1,1 @@
-aa
+zz

See bzr help revisionspec for more information (it's hidden in the revno: section).

share|improve this answer
    
Wow. Good stuff. To improve the quality of your answer though, it would have been great if you also pointed out whereabouts this was in bzr help revisionspec, it's not exactly easy to find. (It's in the explanation of the revno: selector.) But hey thanks! –  janos Mar 12 '13 at 18:35
    
@Janos: Yeah I thought about that, will do that now :) –  AmanicA Mar 12 '13 at 21:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.