##// END OF EJS Templates
strip: factor out revset calculation for strip -B...
Ryan McElroy -
r26624:bcace0fb default
parent child Browse files
Show More
@@ -142,10 +142,7 b' def stripcmd(ui, repo, *revs, **opts):'
142 uniquebm = False
142 uniquebm = False
143 break
143 break
144 if uniquebm:
144 if uniquebm:
145 rsrevs = repo.revs("ancestors(bookmark(%s)) - "
145 rsrevs = repair.stripbmrevset(repo, mark)
146 "ancestors(head() and not bookmark(%s)) - "
147 "ancestors(bookmark() and not bookmark(%s))",
148 mark, mark, mark)
149 revs.update(set(rsrevs))
146 revs.update(set(rsrevs))
150 if not revs:
147 if not revs:
151 del marks[mark]
148 del marks[mark]
@@ -299,3 +299,15 b' def rebuildfncache(ui, repo):'
299 finally:
299 finally:
300 lock.release()
300 lock.release()
301
301
302 def stripbmrevset(repo, mark):
303 """
304 The revset to strip when strip is called with -B mark
305
306 Needs to live here so extensions can use it and wrap it even when strip is
307 not enabled or not present on a box.
308 """
309 return repo.revs("ancestors(bookmark(%s)) - "
310 "ancestors(head() and not bookmark(%s)) - "
311 "ancestors(bookmark() and not bookmark(%s))",
312 mark, mark, mark)
313
General Comments 0
You need to be logged in to leave comments. Login now