infinitepush: do not create transcations if there are no bookmarks to update

Summary:
There are lots of breakages if upstream tests are run with infinitepush
enabled. This patch fixes one issue in test-pull-update.t test.

Test Plan:
Run `test-infinitepush-*`
Run test-pull-update.t with --extra-config-opt=extensions.infinitepush=PATH_TO_INFINITEPUSH.
Make sure that it works fine up to line 115 (later lines may still be broken)

Reviewers: durham, rmcelroy, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4250678

Tasks: 12479677

Signature: t1:4250678:1480689565:792f3d77e08c969a9ffed904815fe7e9aa72f61d
This commit is contained in:
Stanislau Hlebik 2016-12-05 03:31:06 -08:00
parent bfe26123d5
commit f0a4bf7c7b

View File

@ -592,6 +592,8 @@ def _saveremotebookmarks(repo, newbookmarks, remote):
remotenamesext.saveremotenames(repo, remotepath, branches, bookmarks)
def _savelocalbookmarks(repo, bookmarks):
if not bookmarks:
return
with repo.wlock():
with repo.lock():
with repo.transaction('bookmark') as tr: