scmutil.updatedir / crecord

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Mon Jun 20 02:45:33 CDT 2011


Patrick, since you introduced patch.workingbackend, I think we can now
remove scmutil.updatedir, right? I can find no usages in hg or any
endorsed extension. In crecord, I got it to work like this:

diff --git a/crecord/crecord_core.py b/crecord/crecord_core.py
--- a/crecord/crecord_core.py
+++ b/crecord/crecord_core.py
@@ -120,13 +120,10 @@
                 try:
                     ui.debug('applying patch\n')
                     ui.debug(fp.getvalue())
-                    pfiles = {}
-                    try:
-                        from mercurial import scmutil
-                        patch.internalpatch(ui, repo, fp, strip=1,
files=pfiles,
-                                            eolmode=None)
-                        scmutil.updatedir(ui, repo, pfiles)
-                    except ImportError: # pre 3438417a6657
+                    if hasattr(patch, 'workingbackend'): # detect 1.9
+                        patch.internalpatch(ui, repo, fp, strip=1,
eolmode=None)
+                    else:
+                        pfiles = {}
                         try:
                             patch.internalpatch(ui, repo, fp, 1, eolmode=None)
                         except (TypeError, AttributeError): # pre 17cea10c343e


-parren


More information about the Mercurial-devel mailing list