changeset 83:4af0c20daad6

core: make compatible with changes to patch in hg 1.9
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Mon, 20 Jun 2011 11:49:05 +0200
parents 39f1abc89152
children a3518e68d5e2
files crecord/crecord_core.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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