Comments
Patch
@@ -2135,13 +2135,15 @@ def fold(ui, repo, *revs, **opts):
roots = repo.revs('roots(%ld)', revs)
if len(roots) > 1:
- raise util.Abort("set has multiple roots")
+ raise util.Abort(_("cannot fold non-linear revisions "
+ "(multiple roots given)"))
root = repo[roots[0]]
if root.phase() <= phases.public:
raise util.Abort(_("cannot fold public revisions"))
heads = repo.revs('heads(%ld)', revs)
if len(heads) > 1:
- raise util.Abort("set has multiple heads")
+ raise util.Abort(_("cannot fold non-linear revisions "
+ "(multiple heads given)"))
head = repo[heads[0]]
wlock = lock = None
try:
@@ -619,6 +619,12 @@ Test fold
$ hg fold .
single revision specified, nothing to fold
[1]
+ $ hg fold 0::10 --rev 1 --exact
+ abort: cannot fold non-linear revisions (multiple heads given)
+ [255]
+ $ hg fold -r 4 -r 6 --exact
+ abort: cannot fold non-linear revisions (multiple roots given)
+ [255]
$ hg fold 10 1
abort: cannot fold non-linear revisions
(given revisions are unrelated to parent of working directory)