702 else: |
702 else: |
703 bookmarks.append(bookmark) |
703 bookmarks.append(bookmark) |
704 |
704 |
705 if scratchbookmarks: |
705 if scratchbookmarks: |
706 other = hg.peer(repo, opts, source) |
706 other = hg.peer(repo, opts, source) |
707 fetchedbookmarks = other.listkeyspatterns( |
707 try: |
708 b'bookmarks', patterns=scratchbookmarks |
708 fetchedbookmarks = other.listkeyspatterns( |
709 ) |
709 b'bookmarks', patterns=scratchbookmarks |
710 for bookmark in scratchbookmarks: |
710 ) |
711 if bookmark not in fetchedbookmarks: |
711 for bookmark in scratchbookmarks: |
712 raise error.Abort( |
712 if bookmark not in fetchedbookmarks: |
713 b'remote bookmark %s not found!' % bookmark |
713 raise error.Abort( |
714 ) |
714 b'remote bookmark %s not found!' % bookmark |
715 scratchbookmarks[bookmark] = fetchedbookmarks[bookmark] |
715 ) |
716 revs.append(fetchedbookmarks[bookmark]) |
716 scratchbookmarks[bookmark] = fetchedbookmarks[bookmark] |
|
717 revs.append(fetchedbookmarks[bookmark]) |
|
718 finally: |
|
719 other.close() |
717 opts[b'bookmark'] = bookmarks |
720 opts[b'bookmark'] = bookmarks |
718 opts[b'rev'] = revs |
721 opts[b'rev'] = revs |
719 |
722 |
720 if scratchbookmarks or unknownnodes: |
723 if scratchbookmarks or unknownnodes: |
721 # Set anyincoming to True |
724 # Set anyincoming to True |
846 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath) |
849 remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, destpath) |
847 result = orig(ui, repo, dest, *args, **pycompat.strkwargs(opts)) |
850 result = orig(ui, repo, dest, *args, **pycompat.strkwargs(opts)) |
848 if common.isremotebooksenabled(ui): |
851 if common.isremotebooksenabled(ui): |
849 if bookmark and scratchpush: |
852 if bookmark and scratchpush: |
850 other = hg.peer(repo, opts, destpath) |
853 other = hg.peer(repo, opts, destpath) |
851 fetchedbookmarks = other.listkeyspatterns( |
854 try: |
852 b'bookmarks', patterns=[bookmark] |
855 fetchedbookmarks = other.listkeyspatterns( |
853 ) |
856 b'bookmarks', patterns=[bookmark] |
854 remotescratchbookmarks.update(fetchedbookmarks) |
857 ) |
|
858 remotescratchbookmarks.update(fetchedbookmarks) |
|
859 finally: |
|
860 other.close() |
855 _saveremotebookmarks(repo, remotescratchbookmarks, destpath) |
861 _saveremotebookmarks(repo, remotescratchbookmarks, destpath) |
856 if oldphasemove: |
862 if oldphasemove: |
857 exchange._localphasemove = oldphasemove |
863 exchange._localphasemove = oldphasemove |
858 return result |
864 return result |
859 |
865 |