Johan Samyn avatar Johan Samyn committed 5d8f92b

changes for Mercurial 1.9 (fixes <<issue 36>>)

Comments (0)

Files changed (1)

 from mercurial.i18n import _
 from mercurial.node import nullid, nullrev, hex, short
 from mercurial import util, commands, localrepo, repair, extensions, hg
-from mercurial import cmdutil, url, error, patch, discovery
+from mercurial import cmdutil, url, error, patch, discovery, scmutil
 import os, time, shutil, errno
 def prettynode(ui, repo, node):
     patchfile = repo.join(stashfiles(repo, task)[0])
     dirstatefile = repo.join(stashfiles(repo, task)[1])
-    files = {}
+    files = set()
     if os.path.exists(patchfile):
-            fuzz = patch.internalpatch(patchfile, ui, strip = 1,
-                               cwd = repo.root, files = files)
+            fuzz = patch.internalpatch(ui, repo, patchfile, strip = 1,
+                                        files = files)
         except Exception, inst:
             ui.note(str(inst) + '\n')
             ui.warn('patch failed, unable to continue\n')
             return False
         if files:
-            patch.updatedir(ui, repo, files)
+            filesd = {}
+            filesd.fromkeys(files)
+            scmutil.updatedir(ui, repo, filesd)
     if os.path.exists(dirstatefile):
         shutil.copyfile(dirstatefile, repo.join('dirstate'))
     return True
 def getdiff(ui, repo):
-    m = cmdutil.match(repo)
+    m = scmutil.match(repo[None])
     o = patch.diffopts(ui, {'git': True})
     return patch.diff(repo, match = m, opts = o)
     # remove all missing files before getting diff, dirstate is already stashed
-    repo[None].remove(st[3])
+    repo[None].forget(st[3])
     # write out diffs
     hunks = getdiff(ui, repo)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.