Mercurial > evolve
comparison tests/test-topic-push.t @ 5453:7f80558c9b8d stable
topic: treat argument to --topic as a literal topic name explicitly
We already do treat it as a string (i.e. not a special revset language symbol)
that needs to be escaped, because we use %s in repo.revs(), which escapes and
single-quotes the appropriate argument. But now we abort in case user supplies
topic name that doesn't exist.
Before this patch, when user ran something like `hg push --topic .`, this code
would use 'topic(".") - obsolete()' revset, which would get an empty set from
repo.revs() unless there was a topic named "." (unlikely, because this name is
reserved). This code would then add an empty set to the 'rev' argument of the
original hg push command. And `hg push` without -r will try and push
everything, and not just changesets on a specific topic.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 11 Jun 2020 18:50:29 +0800 |
parents | cbfd36046969 |
children | e31e7618cad4 |
comparison
equal
deleted
inserted
replaced
5451:31a72d43d20f | 5453:7f80558c9b8d |
---|---|
190 | |/ | 190 | |/ |
191 o | 1 default public CB | 191 o | 1 default public CB |
192 |/ | 192 |/ |
193 o 0 default public CA | 193 o 0 default public CA |
194 | 194 |
195 | |
196 $ hg outgoing draft --topic nonexistent | |
197 abort: topic 'nonexistent' does not exist! | |
198 [255] | |
199 $ hg push draft --topic nonexistent | |
200 abort: topic 'nonexistent' does not exist! | |
201 [255] | |
202 | |
195 $ hg outgoing draft --topic babar | 203 $ hg outgoing draft --topic babar |
196 comparing with $TESTTMP/draft | 204 comparing with $TESTTMP/draft |
197 searching for changes | 205 searching for changes |
198 5 default babar draft C'A | 206 5 default babar draft C'A |
199 $ hg push draft --topic babar | 207 $ hg push draft --topic babar |