Skip to content
Snippets Groups Projects
Commit 0fc4686d authored by Gregory Szorc's avatar Gregory Szorc
Browse files

exchange: don't report failure from identical bookmarks

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!"

This patch fixes the regression introduced by b901645a8784 by having
the bookmark error reporting code filter identical bookmarks and adds
a test for the behavior.
parent e62c330a
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,10 @@
explicit.remove(b)
# treat as "deleted locally"
pushop.outbookmarks.append((b, dcid, ''))
# identical bookmarks shouldn't get reported
for b, scid, dcid in same:
if b in explicit:
explicit.remove(b)
if explicit:
explicit = sorted(explicit)
......
......@@ -438,3 +438,29 @@
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 @
$ hg push -B @ ../unchanged-b
pushing to ../unchanged-b
searching for changes
no changes found
[1]
$ cd ..
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment