Cédric Krier avatar Cédric Krier committed 48ac74a

copies.copies has been renamed to copies.mergecopies in 2.1

Comments (0)

Files changed (1)

hgreview/__init__.py

 from hashlib import md5
 
 from mercurial.__version__ import version as mercurial_version
-from mercurial import patch, mdiff, copies, node, commands
+from mercurial import patch, mdiff, node, commands
 
 try:
     test = map(int, mercurial_version.split('.')) >= [1, 9]
     from mercurial.scmutil import revpair, matchfiles
 else:
     from mercurial.cmdutil import revpair, matchfiles
+try:
+    test = map(int, mercurial_version.split('.')) >= [2, 1]
+except ValueError:
+    test = True
+if test:
+    from mercurial.copies import mergecopies
+else:
+    from mercurial.copies import copies as mergecopies
 
 
 from rietveld import (GetEmail, GetRpcServer, CheckReviewer, MAX_UPLOAD_SIZE,
     files = {}
 
     # getting informations about copied/moved files
-    copymove_info = copies.mergecopies(repo, base_rev, current_rev, null_rev)[0]
+    copymove_info = mergecopies(repo, base_rev, current_rev, null_rev)[0]
     for newname, oldname in copymove_info.items():
         oldcontent = base_rev[oldname].data()
         newcontent = current_rev[newname].data()
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 ProjectModifiedEvent.java.
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.