After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 661561 - KeyError: 'revision' when comparing files with modifed SVN keyword values
KeyError: 'revision' when comparing files with modifed SVN keyword values
Status: RESOLVED OBSOLETE
Product: meld
Classification: Other
Component: filediff
1.5.x
Other All
: Normal major
: ---
Assigned To: meld-maint
meld-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-12 14:54 UTC by Andy Piper
Modified: 2011-12-07 21:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for svn.py (658 bytes, patch)
2011-11-04 14:19 UTC, Andy Piper
none Details | Review

Description Andy Piper 2011-10-12 14:54:29 UTC
meld breaks when trying to diff a file with a modified SVN keyword value, e.g.

original file: $Id$
modified file: $Id: file.txt 12571 2011-09-29 09:08:17Z piper $

The error is:

---START BACKTRACE---
Traceback (most recent call last):
  • File "/usr/lib/meld/meld/task.py", line 130 in iteration
    ret = task()
  • File "/usr/lib/meld/meld/vcview.py", line 322 in _search_recursively_iter
    self.vc.cache_inventory(rootname)
  • File "/usr/lib/meld/meld/vc/_vc.py", line 205 in cache_inventory
    self._tree_cache = self._lookup_tree_cache(directory)
  • File "/usr/lib/meld/meld/vc/svn.py", line 111 in _lookup_tree_cache
    self._update_tree_state_cache(rootdir, tree_state)
  • File "/usr/lib/meld/meld/vc/svn.py", line 99 in _update_tree_state_cache
    rev = status.attrib["revision"]
KeyError: 'revision'
---END BACKTRACE---

Reverting the line back to its original value works around this, but this is not practical when diffing a directory with many modified files.

The attached patch 'fixes' the problem, by setting a 'n/a' value for files where the SVN revision cannot be obtained. The patch has been tested against meld 1.5.1 on Ubuntu 10.04 (meld-1.5.1-1~getdeb1.deb)
Comment 1 Kai Willadsen 2011-10-17 11:28:17 UTC
There's no patch attached.

Also, I'm pretty sure this would have been fixed by:
http://git.gnome.org/browse/meld/commit/?id=8d7e4aff715a933957a9cec99175fd15fec846a6

Could you please test with Meld 1.5.2 or later? (Note that you don't need to install Meld to test it. Just run bin/meld from the directory you untar it into.)
Comment 2 Andy Piper 2011-11-04 14:19:16 UTC
Created attachment 200691 [details] [review]
Patch for svn.py
Comment 3 Andy Piper 2011-11-04 14:25:24 UTC
Sorry for the delay in replying. The patch is now attached.

I can confirm that this bug still exists in meld 1.5.2

Another way to reproduce this bug:

1) add and commit a file to SVN containing a line like this:

# $Id: file.txt 8936 2010-09-20 12:24:51Z piper $

2) set the svn:keywords property on the file to "Id". Do NOT commit this change to SVN!

3) Try to view the file in meld.


NB: If the file is now modified so the line above is this:

# $Id$

...the file can now be viewed in meld successfully
Comment 4 Kai Willadsen 2011-11-29 07:36:39 UTC
I understand and can replicate those instructions... but that's not the same problem you originally reported; that bug is already filed as bug 557615. We don't have a good way to deal with keywords, and get the patch failed message (I have a patch that seems to work, but it won't support svn 1.7).

Can you actually reproduce the earlier traceback with current Meld? I can't see how the patch you posted could fix anything that the commit I linked to above didn't.
Comment 5 Andy Piper 2011-12-07 11:25:07 UTC
Hi, sorry for the getting these 2 issues mixed up.

I can't reproduce the original issue with meld 1.5.2, so that bug can remain closed.

It is a pity that SVN keywords are still causing problems, good luck with your patches for that! :-)
Comment 6 Kai Willadsen 2011-12-07 21:21:08 UTC
Great. Thanks for the feedback, and for the repro for the other bug.