version.py
changeset 138 7dbe0ee1a27b
parent 132 0e857c4a67de
--- a/version.py	Mon Feb 16 03:25:00 2009 +0200
+++ b/version.py	Sun Sep 13 00:49:29 2009 +0300
@@ -19,17 +19,17 @@
         return _VERSION
 
     # code adapted from mercurial.commands.identify
-    from mercurial import ui, hg, util
+    from mercurial import ui, hg, encoding
     from mercurial.node import short
     
     # open the repo
     repo = hg.repository(ui.ui(), path)
 
     # the working copy change context
-    ctx = repo.workingctx()
+    ctx = repo[None]
 
     # branch
-    branch = util.tolocal(ctx.branch())
+    branch = encoding.tolocal(ctx.branch())
     
     # map default -> None
     if branch == 'default' :
@@ -55,8 +55,13 @@
         Currently, this assumes that the given path points to a local Mercurial repo.
     """
     
-    # get info
-    branch, tags, parents, modified = version_mercurial(path)
+    try :
+        # get info
+        branch, tags, parents, modified = version_mercurial(path)
+
+    except :
+        # XXX: ignore
+        raise
 
     # tags: <tag> [ "-" <tag> [ ... ]]
     if tags :