1. Lantiq
  2. Untitled project
  3. projrc


Angel Ezquerra  committed 1c632c6

Make extension compatible with mercurial 2.3

The hg.clone method does not returna localrepository object anymore, but a
localpeer object. Thus, if the localrepo module defines a localpeer class we
must get the localrepository object from the peer object by calling its local()
method, so that then we can pass it to the original update method.

  • Participants
  • Parent commits 18892a0
  • Branches default

Comments (0)

Files changed (1)

File projrc.py

View file
  • Ignore whitespace
 import os, sys, fnmatch
 from operator import itemgetter
 from mercurial import hg, extensions, pushkey, config, util, error
-from mercurial import commands, dispatch, cmdutil
+from mercurial import commands, dispatch, cmdutil, localrepo
 from mercurial.i18n import _
 # Compatibility import to handle API changes between 1.8 and 1.9
     # We then do the update, if necessary.
     if uprev[0]:
-        origupdate(dst, uprev[0])
+        dstrepo = dst
+        if hasattr(localrepo, 'localpeer'):
+            dstrepo = dst.local()
+        origupdate(dstrepo, uprev[0])
     return src, dst
 def incoming(orig, ui, repo, srcpath, *args, **kwargs):