Remove unnecessary initialization, add assertions.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 10 Feb 2007 13:53:06 +0000 (14:53 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 10 Feb 2007 13:53:06 +0000 (14:53 +0100)
1  2 
branchprops.py
logwalker.py

diff --cc branchprops.py
index 1b14f0b5e948841e92bfa1b1538735257460e61b,1b14f0b5e948841e92bfa1b1538735257460e61b..8c5cca3ace94fa76e62a0d21952e0b1d19e780d7
@@@ -44,10 -44,10 +44,12 @@@ class BranchPropertyList
  
          return props
  
--    def get_properties(self, path, revnum):
++    def get_properties(self, path, origrevnum):
++        assert path is not None
++        assert isinstance(origrevnum, int) and origrevnum >= 0
          proplist = {}
--        revnum = self.log.find_latest_change(path, revnum)
--        assert revnum is not None
++        revnum = self.log.find_latest_change(path, origrevnum)
++        assert revnum is not None, "can't find latest change for %r:%r" % (path, origrevnum)
  
          proplist = {}
          for (name, value) in self.cachedb.execute("select name, value from branchprop where revnum=%d and branchpath='%s'" % (revnum, path)):
diff --cc logwalker.py
index efe243f162fed94d095d070b8c2f19ac09fe66f9,efe243f162fed94d095d070b8c2f19ac09fe66f9..862ca332640cccf8fdb18416e1e76514b1b57ce0
@@@ -219,6 -219,6 +219,8 @@@ class LogWalker(object)
          :param path: Path to check for changes
          :param revnum: First revision to check
          """
++        assert isinstance(path, str)
++        assert isinstance(revnum, int) and revnum >= 0
          if revnum > self.saved_revnum:
              self.fetch_revisions(revnum)