[PATCH 1 of 3 STABLE v2] tests: add test for failing bookmark push code
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri Oct 24 17:41:10 CDT 2014
On 10/24/2014 08:07 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1414171261 25200
> # Fri Oct 24 10:21:01 2014 -0700
> # Branch stable
> # Node ID 8344ea64087d5eaab42709aaab6daa38dbde3db8
> # Parent eb763217152ab2b472416bcc57722451c317f282
> tests: add test for failing bookmark push code
>
> b901645a8784 regressed the behavior of pushing an unchanged bookmark to
> a remote. Before that commit, pushing a unchanged bookmark would result
> in "exporting bookmark @" being printed. After that commit, we now see
> an incorrect message "bookmark %s does not exist on the local or remote
> repository!"
I would argue that the "exporting bookmark X" is from if no change is
actually made to the bookmark.
> This patch adds a test that demonstrates the faulty behavior.
>
> diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
> --- a/tests/test-bookmarks-pushpull.t
> +++ b/tests/test-bookmarks-pushpull.t
> @@ -437,4 +437,32 @@ pushing a new bookmark on a new head doe
> $ hg -R ../b id -r W
> cc978a373a53 tip W
>
> $ cd ..
> +
> +pushing an unchanged bookmark should result in no changes
> +
> + $ hg init unchanged-a
> + $ hg init unchanged-b
> + $ cd unchanged-a
> + $ echo initial > foo
> + $ hg commit -A -m initial
> + adding foo
> + $ hg bookmark @
> + $ hg push -B @ ../unchanged-b
> + pushing to ../unchanged-b
> + searching for changes
> + adding changesets
> + adding manifests
> + adding file changes
> + added 1 changesets with 1 changes to 1 files
> + exporting bookmark @
> +
> +BUGGY We should simply say "no changes found"
> + $ hg push -B @ ../unchanged-b
> + pushing to ../unchanged-b
> + searching for changes
> + bookmark @ does not exist on the local or remote repository!
> + no changes found
> + [2]
> +
> + $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list