Fix style hook for Mercurial >= 1.1
authorAli Saidi <saidi@eecs.umich.edu>
Tue, 13 Jan 2009 05:14:04 +0000 (00:14 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Tue, 13 Jan 2009 05:14:04 +0000 (00:14 -0500)
util/style.py

index a117fab70bbd187347060c5f839af09b8b8147d9..fa9a30b54851c1310b146436fb9420567dc4e5c4 100644 (file)
@@ -304,7 +304,12 @@ def do_check_whitespace(ui, repo, *files, **args):
             if prompt(fname):
                 return True
 
-    wctx = repo.workingctx()
+    try:
+        wctx = repo.workingctx()
+    except:
+        from mercurial import context
+        wctx = context.workingctx(repo)
+
     for fname in modified:
         if skip(fname):
             continue