diff rhodecode/lib/helpers.py @ 2203:d9972f76322e beta

added emulation of pull hook for git-backend, and dummy git-push hook
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 19 Apr 2012 01:27:37 +0200
parents 04d3fae0e4c0
children 76947224bf27 a437a986d399 6c0f76330d91
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Wed Apr 18 02:07:38 2012 +0200
+++ b/rhodecode/lib/helpers.py	Thu Apr 19 01:27:37 2012 +0200
@@ -87,7 +87,7 @@
     if not token_key in session:
         try:
             token = hashlib.sha1(str(random.getrandbits(128))).hexdigest()
-        except AttributeError: # Python < 2.4
+        except AttributeError:  # Python < 2.4
             token = hashlib.sha1(str(random.randrange(2 ** 128))).hexdigest()
         session[token_key] = token
         if hasattr(session, 'save'):
@@ -454,11 +454,14 @@
                         revision=rev.raw_id),
                     title=tooltip(message(rev)), class_='tooltip')
         )
-        # get only max revs_top_limit of changeset for performance/ui reasons
-        revs = [
-            x for x in repo.get_changesets(revs_ids[0],
-                                           revs_ids[:revs_top_limit][-1])
-        ]
+
+        revs = []
+        if len(filter(lambda v: v != '', revs_ids)) > 0:
+            # get only max revs_top_limit of changeset for performance/ui reasons
+            revs = [
+                x for x in repo.get_changesets(revs_ids[0],
+                                               revs_ids[:revs_top_limit][-1])
+            ]
 
         cs_links = []
         cs_links.append(" " + ', '.join(