diff rhodecode/model/pull_request.py @ 3015:16af24982e30 beta

Multiple changes for compare system - count number of changed lines and files - add combined compare button into the old per changeset compare - fixed some logic for remote & bundle compare system - added few tests for git compare
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 18 Nov 2012 23:17:02 +0100
parents bf96fd1920c1
children c2a206162062
line wrap: on
line diff
--- a/rhodecode/model/pull_request.py	Sun Nov 18 21:27:41 2012 +0100
+++ b/rhodecode/model/pull_request.py	Sun Nov 18 23:17:02 2012 +0100
@@ -185,21 +185,21 @@
 
                 revs = [
                     "ancestors(%s('%s')) and not ancestors(%s('%s'))" % (
+                        _revset_predicates[other_ref[0]], other_ref[1],
                         _revset_predicates[org_ref[0]], org_ref[1],
-                        _revset_predicates[other_ref[0]], other_ref[1]
                    )
                 ]
 
                 out = scmutil.revrange(org_repo._repo, revs)
-                for cs in reversed(out):
+                for cs in (out):
                     changesets.append(org_repo.get_changeset(cs))
             elif alias == 'git':
                 so, se = org_repo.run_git_command(
-                    'log --pretty="format: %%H" -s -p %s..%s' % (org_ref[1],
+                    'log --reverse --pretty="format: %%H" -s -p %s..%s' % (org_ref[1],
                                                                      other_ref[1])
                 )
                 ids = re.findall(r'[0-9a-fA-F]{40}', so)
-                for cs in reversed(ids):
+                for cs in (ids):
                     changesets.append(org_repo.get_changeset(cs))
 
         return changesets