Comment 1 for bug 765881

Revision history for this message
John A Meinel (jameinel) wrote :

A possible patch, basically, just short-cut out if we aren't actually updating the new data.

=== modified file 'bzrlib/_dirstate_helpers_pyx.pyx'
--- bzrlib/_dirstate_helpers_pyx.pyx 2010-08-27 18:02:22 +0000
+++ bzrlib/_dirstate_helpers_pyx.pyx 2011-04-19 12:58:26 +0000
@@ -916,8 +916,12 @@
             entry[1][0] = ('f', link_or_sha1, stat_value.st_size,
                            executable, packed_stat)
         else:
- entry[1][0] = ('f', '', stat_value.st_size,
- executable, DirState.NULLSTAT)
+ new = ('f', '', stat_value.st_size, executable, DirState.NULLSTAT)
+ if entry[1][0] == new:
+ # We explicitly return early here, because we aren't changing
+ # anything, so we don't want to set IN_MEMORY_MODIFIED
+ return None
+ entry[1][0] = new
     elif minikind == c'd':
         link_or_sha1 = None
         entry[1][0] = ('d', '', 0, False, packed_stat)