Skip to contentSkip to conversation

Diff between Branches

DISCUSSION Carles Pina i Estany 3 participants 5 messages Oct 31, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I'm novice with Bazaar.
I would like to diff between gettext branch and trunk. I did:

bzr branch http://bzr.savannah.gnu.org/r/grub/people/robertmh/gettext/
cd gettext
bzr diff -r branch:http://bzr.savannah.gnu.org/r/ub/trunk/grub

But I have some unexpected results like adding files and removing files that I would not expect:

=== added file 'AUTHORS'
--- AUTHORS 1970-01-01 00:00:00 +0000
+++ AUTHORS 2009-10-31 12:19:08 +0000

and then:
=== removed file 'AUTHORS'
--- AUTHORS 2005-09-03 16:54:27 +0000
+++ AUTHORS 1970-01-01 00:00:00 +0000

The content of the "old2 and "new" AUTHORS files looks similar, even though the date is not similar :-)

Am I doing something in the incorrect way? Or I'm doing it in bad timing?

Thanks,

Signature · 2 lines
Carles Pina i Estany
	http://pinux.info
#1 lore raw

AUTHORS 1970-01-01 00:00:00 +0000

Quoted 18 lines · Carles Pina i Estany

I'm novice with Bazaar.
I would like to diff between gettext branch and trunk. I did:

bzr branch http://bzr.savannah.gnu.org/r/grub/people/robertmh/gettext/
cd gettext
bzr diff -r branch:http://bzr.savannah.gnu.org/r/ub/trunk/grub

But I have some unexpected results like adding files and removing files that I would not expect:

=== added file 'AUTHORS'

AUTHORS 2009-10-31 12:19:08 +0000 renamed from AUTHORS 1970-01-01 00:00:00 +0000 +0 -0

and then:
=== removed file 'AUTHORS'

AUTHORS 1970-01-01 00:00:00 +0000 renamed from AUTHORS 2005-09-03 16:54:27 +0000 +0 -0

This usually means that there is a problem with the way the branches were created or with the way they've been managed, such that the files in each branch do not have common ancestry. (Bazaar assigns each file a unique file-id in order to support good rename tracking, and will only consider two files to be different versions of the same file if they have the same file-id; you can see the file-id with e.g. 'bzr ls --show-ids'.)

I haven't looked at these two branches to find out exactly what's happened.

Signature · 1 line
Colin Watson                                       [[email protected]]
#4 lore raw
In reply to Carles Pina i Estany
Quoted 7 lines · Carles Pina i Estany

Hi,

I'm novice with Bazaar.
I would like to diff between gettext branch and trunk. I did:

bzr branch http://bzr.savannah.gnu.org/r/grub/people/robertmh/gettext/

The gettext branch was based on an old trunk, I've just regenerated it, try branching again.

Quoted 4 lines

bzr diff -r branch:http://bzr.savannah.gnu.org/r/ub/trunk/grub

But I have some unexpected results like adding files and removing files that I would not expect:

Is this what you wanted?

bzr diff -r ancestor:bzr+ssh://bzr.savannah.gnu.org/grub/trunk/grub

Btw, if you're just trying to resync, it's better if you use bzr for that, e.g.:

$ bzr pull bzr+ssh://bzr.savannah.gnu.org/grub/trunk/grub
bzr: ERROR: These branches have diverged. Use the missing command to see how.                                                                               
Use the merge command to reconcile them.
$ bzr merge bzr+ssh://bzr.savannah.gnu.org/grub/trunk/grub
[...]
Text conflict in conf/common.rmk
Text conflict in kern/misc.c
Text conflict in util/grub-mkconfig_lib.in
Text conflict in util/grub.d/00_header.in
Text conflict in util/grub.d/10_linux.in
5 conflicts encountered.

<some manual work with conf/common.rmk and conf/common.rmk.*>

$ bzr resolve conf/common.rmk

<repeat untill all conflicts are resolved, then commit>

After this is done, you can push to /people/<your-dir>/gettext or so.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#2 lore raw
In reply to Colin Watson
Quoted 4 lines · Colin Watson

This usually means that there is a problem with the way the branches were created or with the way they've been managed, such that the files in each branch do not have common ancestry.

I had to regenerate the commits one by one (fortunately there weren't many).

Do you know a more efficient way?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#3 lore raw
Quoted 8 lines · Robert Millan
Quoted 3 lines · Colin Watson

This usually means that there is a problem with the way the branches were created or with the way they've been managed, such that the files in each branch do not have common ancestry.

I had to regenerate the commits one by one (fortunately there weren't many).

Do you know a more efficient way?

It may be possible to use the 'bzr replay' command from the bzr-rebase plugin. I don't use this often myself, but it seems like nominally the right answer.

Signature · 1 line
Colin Watson                                       [[email protected]]