From: Eric S. Raymond Date: Sat, 15 Nov 2014 12:52:39 +0000 (-0500) Subject: Another move away from using natve IDs internally. X-Git-Tag: 0.9~26 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=e8e56774638a25df29ee612c8fd9fc5e9c206da8;p=src.git Another move away from using natve IDs internally. --- diff --git a/src b/src index 937b4aa..b4bd39a 100755 --- a/src +++ b/src @@ -163,7 +163,7 @@ class HistoryEntry: self.child = None self.branches = set([]) def selected(self): - return self.native == self.history.current() + return self == self.history.current() def unixtime(self): try: return calendar.timegm(time.strptime(self.date, "%Y-%m-%dT%H:%M:%SZ")) @@ -208,14 +208,14 @@ class History: def current(self): "Return the revision currently checked out." try: - return self.lockrevs[0] + return self.by_native_d[self.lockrevs[0]] except IndexError: croak("no current revision? src checkout to recover") def current_branch(self, backwards=False): "Return a list of items that are descendants or ancestors of current." if debug >= DEBUG_SEQUENCE: - print "current_branch(%s)" % self.current() - p = s = self.native_to_revno(self.current()) + print "current_branch(%s)" % self.current().native + p = s = self.current().revno selection = [self.by_revno(p)] while True: rev = self.revno_to_native(p) @@ -237,7 +237,7 @@ class History: def tip(self, rev=None): "Return the tip revision of the branch of the given native revision." if rev is None: - rev = self.current() + rev = self.current().native s = self.by_native_d[rev] while True: if s.child == None: