largefile: explain why no monkey patching on a repoview
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 17 Dec 2014 12:19:33 -0800
changeset 23635 faec11cfb645
parent 23634 bbd50e13c006
child 23636 ab3b8d8fd2a0
largefile: explain why no monkey patching on a repoview The comment requested for investigations, here they are.
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Wed Dec 17 12:10:16 2014 -0800
+++ b/hgext/largefiles/overrides.py	Wed Dec 17 12:19:33 2014 -0800
@@ -1122,8 +1122,15 @@
 # Calling purge with --all will cause the largefiles to be deleted.
 # Override repo.status to prevent this from happening.
 def overridepurge(orig, ui, repo, *dirs, **opts):
-    # XXX large file status is buggy when used on repo proxy.
-    # XXX this needs to be investigate.
+    # XXX Monkey patching a repoview will not work. The assigned attribute will
+    # be set on the unfiltered repo, but we will only lookup attributes in the
+    # unfiltered repo if the lookup in the repoview object itself fails. As the
+    # monkey patched method exists on the repoview class the lookup will not
+    # fail. As a result, the original version will shadow the monkey patched
+    # one, defeating the monkey patch.
+    #
+    # As a work around we use an unfiltered repo here. We should do something
+    # cleaner instead.
     repo = repo.unfiltered()
     oldstatus = repo.status
     def overridestatus(node1='.', node2=None, match=None, ignored=False,