Source

hgattic-queue / record-fix

Full commit
From: Ross Cohen <rcohen@snurgle.org>
Fix for properly including/excluding hunks during interactive shelve.

diff --git a/attic.py b/attic.py
--- a/attic.py
+++ b/attic.py
@@ -381,6 +381,15 @@
 
     return backups
 
+def hunk__eq__(hunk1, hunk2):
+    if type(hunk1) != type(hunk2):
+        return False
+    d1 = hunk1.__dict__.copy()
+    d2 = hunk2.__dict__.copy()
+    del d1['toline']
+    del d2['toline']
+    return d1 == d2
+
 def interactiveshelve(ui, repo, name, pats, opts):
     """interactively select changes to set aside"""
     if not ui.interactive:
@@ -390,6 +399,9 @@
     except KeyError:
         raise util.Abort(_("'record' extension not loaded"))
 
+    # monkeypatch record extension
+    record.hunk.__eq__ = hunk__eq__
+
     def shelvefunc(ui, repo, message, match, opts):
         files = []
         if match.files():