##// END OF EJS Templates
rewriteutil: add utility function to check if we can create new unstable cset...
Pulkit Goyal -
r35242:27d5c2d2 default
parent child Browse files
Show More
@@ -0,0 +1,25 b''
1 # rewriteutil.py - utility functions for rewriting changesets
2 #
3 # Copyright 2017 Octobus <contact@octobus.net>
4 #
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
7
8 from __future__ import absolute_import
9
10 from . import (
11 obsolete,
12 revset,
13 )
14
15 def disallowednewunstable(repo, revs):
16 """Checks whether editing the revs will create new unstable changesets and
17 are we allowed to create them.
18
19 To allow new unstable changesets, set the config:
20 `experimental.evolution.allowunstable=True`
21 """
22 allowunstable = obsolete.isenabled(repo, obsolete.allowunstableopt)
23 if allowunstable:
24 return revset.baseset()
25 return repo.revs("(%ld::) - %ld", revs, revs)
General Comments 0
You need to be logged in to leave comments. Login now