diff mercurial/localrepo.py @ 6740:b148e9099133

use repo.changectx(None) to get a workingctx
author Matt Mackall <mpm@selenic.com>
date Thu, 26 Jun 2008 13:46:29 -0500
parents c9fbd6ec3489
children 2d54e7c1e69d
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Jun 25 17:35:20 2008 -0500
+++ b/mercurial/localrepo.py	Thu Jun 26 13:46:29 2008 -0500
@@ -485,12 +485,9 @@
 
     def changectx(self, changeid):
         if changeid == None:
-            raise "nope!"
+            return context.workingctx(self)
         return context.changectx(self, changeid)
 
-    def workingctx(self):
-        return context.workingctx(self)
-
     def parents(self, changeid=None):
         '''
         get list of changectxs for parents of changeid or working directory
@@ -1202,7 +1199,7 @@
         return [n for (r, n) in heads]
 
     def branchheads(self, branch=None, start=None):
-        branch = branch is None and self.workingctx().branch() or branch
+        branch = branch is None and self.changectx(None).branch() or branch
         branches = self.branchtags()
         if branch not in branches:
             return []