##// END OF EJS Templates
mq: wrap qimport phase movement in a transaction...
Pierre-Yves David -
r22049:86c5318b default
parent child Browse files
Show More
@@ -1975,16 +1975,21 class queue(object):
1975 lastparent = None
1975 lastparent = None
1976
1976
1977 diffopts = self.diffopts({'git': git})
1977 diffopts = self.diffopts({'git': git})
1978 tr = repo.transaction('qimport')
1979 try:
1978 for r in rev:
1980 for r in rev:
1979 if not repo[r].mutable():
1981 if not repo[r].mutable():
1980 raise util.Abort(_('revision %d is not mutable') % r,
1982 raise util.Abort(_('revision %d is not mutable') % r,
1981 hint=_('see "hg help phases" for details'))
1983 hint=_('see "hg help phases" '
1984 'for details'))
1982 p1, p2 = repo.changelog.parentrevs(r)
1985 p1, p2 = repo.changelog.parentrevs(r)
1983 n = repo.changelog.node(r)
1986 n = repo.changelog.node(r)
1984 if p2 != nullrev:
1987 if p2 != nullrev:
1985 raise util.Abort(_('cannot import merge revision %d') % r)
1988 raise util.Abort(_('cannot import merge revision %d')
1989 % r)
1986 if lastparent and lastparent != r:
1990 if lastparent and lastparent != r:
1987 raise util.Abort(_('revision %d is not the parent of %d')
1991 raise util.Abort(_('revision %d is not the parent of '
1992 '%d')
1988 % (r, lastparent))
1993 % (r, lastparent))
1989 lastparent = p1
1994 lastparent = p1
1990
1995
@@ -2010,6 +2015,9 class queue(object):
2010 self.parseseries()
2015 self.parseseries()
2011 self.applieddirty = True
2016 self.applieddirty = True
2012 self.seriesdirty = True
2017 self.seriesdirty = True
2018 tr.close()
2019 finally:
2020 tr.release()
2013
2021
2014 for i, filename in enumerate(files):
2022 for i, filename in enumerate(files):
2015 if existing:
2023 if existing:
General Comments 0
You need to be logged in to leave comments. Login now