Skip to content
Snippets Groups Projects
Commit bcace0fbb4c8 authored by Ryan McElroy's avatar Ryan McElroy
Browse files

strip: factor out revset calculation for strip -B

This will allow reusing it in evolve and overriding it in other extensions.
parent 5a95fe44121d
No related merge requests found
......@@ -142,10 +142,7 @@
uniquebm = False
break
if uniquebm:
rsrevs = repo.revs("ancestors(bookmark(%s)) - "
"ancestors(head() and not bookmark(%s)) - "
"ancestors(bookmark() and not bookmark(%s))",
mark, mark, mark)
rsrevs = repair.stripbmrevset(repo, mark)
revs.update(set(rsrevs))
if not revs:
del marks[mark]
......
......@@ -299,3 +299,15 @@
finally:
lock.release()
def stripbmrevset(repo, mark):
"""
The revset to strip when strip is called with -B mark
Needs to live here so extensions can use it and wrap it even when strip is
not enabled or not present on a box.
"""
return repo.revs("ancestors(bookmark(%s)) - "
"ancestors(head() and not bookmark(%s)) - "
"ancestors(bookmark() and not bookmark(%s))",
mark, mark, mark)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment