Commits

Peter Arrenbrecht committed 4af0c20

core: make compatible with changes to patch in hg 1.9

  • Participants
  • Parent commits 39f1abc

Comments (0)

Files changed (1)

crecord/crecord_core.py

                 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