changeset 3725:f73a63831d3f beta

pullrequests: optimize locating changeset to compare We only need the max revision - that is much faster when a branch is specified.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 05 Apr 2013 00:40:58 +0200
parents a327492d84df
children 630c98f52416
files rhodecode/model/pull_request.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/model/pull_request.py	Fri Apr 05 00:40:58 2013 +0200
+++ b/rhodecode/model/pull_request.py	Fri Apr 05 00:40:58 2013 +0200
@@ -183,13 +183,13 @@
                     'rev': 'id',
                 }
 
-            org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]],
-                                         safe_str(org_ref[1]))
+            org_rev_spec = "max(%s('%s'))" % (_revset_predicates[org_ref[0]],
+                                              safe_str(org_ref[1]))
             org_revs = scmutil.revrange(org_repo._repo, [org_rev_spec])
             org_rev = org_repo._repo[org_revs[-1] if org_revs else -1].hex()
 
-            other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]],
-                                           safe_str(other_ref[1]))
+            other_rev_spec = "max(%s('%s'))" % (_revset_predicates[other_ref[0]],
+                                                safe_str(other_ref[1]))
             other_revs = scmutil.revrange(other_repo._repo, [other_rev_spec])
             other_rev = other_repo._repo[other_revs[-1] if other_revs else -1].hex()