changeset 17423:63e9b0732518 stable

strip: fix revset usage (issue3604) The `repair` code builds a giant revset query instead of using the "%lr" idiom. It is inefficient and crash when the number of stripped changeset is too big. This changeset replaces the bad code by a better revset usage.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 31 Aug 2012 23:27:26 +0200
parents 93bc65e970c0
children c954447336e1 7a6ab3a802c5
files mercurial/repair.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repair.py	Thu Aug 02 13:51:49 2012 +0200
+++ b/mercurial/repair.py	Fri Aug 31 23:27:26 2012 +0200
@@ -111,9 +111,8 @@
         saverevs.difference_update(descendants)
     savebases = [cl.node(r) for r in saverevs]
     stripbases = [cl.node(r) for r in tostrip]
-    rset = ' or '.join([str(r) for r in tostrip])
-    newbmtarget = repo.revs('sort(heads(ancestors(%r) - (%r)), -rev)',
-                            rset, rset)
+    newbmtarget = repo.revs('sort(heads((::%ld) - (%ld)), -rev)',
+                            tostrip, tostrip)
     if newbmtarget:
         newbmtarget = newbmtarget[0]
     else: