# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1404149929 14400 # Node ID 85ec2a55fe7ccaa4b0e24cf9872c07916cc793e3 # Parent f48cd2f48d14e094d9b5f42a4d57a567e464cd85 fold: improve error messages for multiple heads and roots This commit adds hints and i18n to the error messages about non-linear revisions, along with corresponding tests. diff -r f48cd2f48d14 -r 85ec2a55fe7c hgext/evolve.py --- a/hgext/evolve.py Mon Jun 30 13:37:15 2014 -0400 +++ b/hgext/evolve.py Mon Jun 30 13:38:49 2014 -0400 @@ -2135,13 +2135,15 @@ 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: diff -r f48cd2f48d14 -r 85ec2a55fe7c tests/test-evolve.t --- a/tests/test-evolve.t Mon Jun 30 13:37:15 2014 -0400 +++ b/tests/test-evolve.t Mon Jun 30 13:38:49 2014 -0400 @@ -619,6 +619,12 @@ $ 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)