# HG changeset patch # User Pierre-Yves David # Date 1535985692 -7200 # Node ID 1aa5f851d2c082115e2b193953b81a24b4bfff72 # Parent fbc51e98cf13ca9524dea43906f399daffc4010a stack: clarify s# error message in case of branch A branch might have a lots of changeset, with all of them public. diff -r fbc51e98cf13 -r 1aa5f851d2c0 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Sep 03 16:29:02 2018 +0200 +++ b/hgext3rd/topic/__init__.py Mon Sep 03 16:41:32 2018 +0200 @@ -288,7 +288,10 @@ try: r = revs[idx] except IndexError: - msg = _('cannot resolve "%s": %s "%s" has only %d changesets') + if ttype == 'topic': + msg = _('cannot resolve "%s": %s "%s" has only %d changesets') + elif ttype == 'branch': + msg = _('cannot resolve "%s": %s "%s" has only %d non-public changesets') raise error.Abort(msg % (name, ttype, tname, len(revs) - 1)) # b0 or t0 can be None if r == -1 and idx == 0: diff -r fbc51e98cf13 -r 1aa5f851d2c0 tests/test-stack-branch.t --- a/tests/test-stack-branch.t Mon Sep 03 16:29:02 2018 +0200 +++ b/tests/test-stack-branch.t Mon Sep 03 16:41:32 2018 +0200 @@ -92,7 +92,7 @@ $ hg up foo 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg up b42 - abort: cannot resolve "b42": branch "foo" has only 4 changesets + abort: cannot resolve "b42": branch "foo" has only 4 non-public changesets [255] $ hg up b2 0 files updated, 0 files merged, 2 files removed, 0 files unresolved diff -r fbc51e98cf13 -r 1aa5f851d2c0 tests/test-topic-stack.t --- a/tests/test-topic-stack.t Mon Sep 03 16:29:02 2018 +0200 +++ b/tests/test-topic-stack.t Mon Sep 03 16:41:32 2018 +0200 @@ -242,7 +242,7 @@ $ hg up s2 - abort: cannot resolve "s2": branch "default" has only 0 changesets + abort: cannot resolve "s2": branch "default" has only 0 non-public changesets [255] $ hg topic foo marked working directory as topic: foo