Commits

Michal Sznajder committed 46b4500

wctxactions: fix largefiles support

search over extensions.extensions() made sense when THG supported kbfiles. kbfiles
are gone and largefiles are distributed with hg thus command.add() is used
directly with correct parameters

Comments (0)

Files changed (1)

tortoisehg/hgqt/wctxactions.py

     return True
 
 def add(parent, ui, repo, files):
-    haslf = 'largefiles' in repo.extensions()
-    if haslf:
+    if 'largefiles' in repo.extensions():
         result = lfprompt.promptForLfiles(parent, ui, repo, files)
         if not result:
             return False
         files, lfiles = result
-        for name, module in extensions.extensions():
-            if name == 'largefiles':
-                override_add = module.overrides.override_add
-                if files:
-                    override_add(commands.add, ui, repo, *files)
-                if lfiles:
-                    override_add(commands.add, ui, repo, large=True, *lfiles)
-                return True
-    commands.add(ui, repo, *files)
+        if files:
+            commands.add(ui, repo, normal=True, *files)
+        if lfiles:
+            commands.add(ui, repo, lfsize='', normal=False, large=True, *lfiles)
+    else:
+        commands.add(ui, repo, *files)
     return True
 
 def addlf(parent, ui, repo, files):
-    for name, module in extensions.extensions():
-        if name == 'largefiles':
-            override_add = module.overrides.override_add
-            override_add(commands.add, ui, repo, large=True, *files)
-            return True
-    return False
+    commands.add(ui, repo, lfsize='', normal=None, large=True, *files)
+    return True
 
 def guessRename(parent, ui, repo, files):
     from tortoisehg.hgqt.guess import DetectRenameDialog