]> arthur.barton.de Git - bup.git/commitdiff
Since 'latest' is computed by revs[0], it must exist, so don't test it.
authorRob Browning <rlb@defaultvalue.org>
Fri, 23 Nov 2012 20:32:39 +0000 (14:32 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 23 Nov 2012 21:34:38 +0000 (15:34 -0600)
Remove the unnecessary "if latest:" conditional from
BranchList._mksubs().  Given the fact that latest used to be computed
via max(revs), and is now computed by revs[0], there's no way it
wouldn't exist.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/vfs.py

index 26aeb00f4f25739f1c232820f653b7c5c388a8a7..9bed065909c3d8752ac113ecf63a015d67f90207 100644 (file)
@@ -498,13 +498,12 @@ class BranchList(Node):
                 t1.ctime = t1.mtime = date
                 self._subs[tag] = t1
 
-        if latest:
-            (date, commit) = latest
-            commithex = commit.encode('hex')
-            target = '../.commit/%s/%s' % (commithex[:2], commithex[2:])
-            n1 = FakeSymlink(self, 'latest', target)
-            n1.ctime = n1.mtime = date
-            self._subs['latest'] = n1
+        (date, commit) = latest
+        commithex = commit.encode('hex')
+        target = '../.commit/%s/%s' % (commithex[:2], commithex[2:])
+        n1 = FakeSymlink(self, 'latest', target)
+        n1.ctime = n1.mtime = date
+        self._subs['latest'] = n1
 
 
 class RefList(Node):