Show More
@@ -683,12 +683,10 b' def _lookupwrap(orig):' | |||||
683 | def _pull(orig, ui, repo, source=b"default", **opts): |
|
683 | def _pull(orig, ui, repo, source=b"default", **opts): | |
684 | opts = pycompat.byteskwargs(opts) |
|
684 | opts = pycompat.byteskwargs(opts) | |
685 | # Copy paste from `pull` command |
|
685 | # Copy paste from `pull` command | |
686 |
|
|
686 | path = urlutil.get_unique_pull_path_obj( | |
687 | b"infinite-push's pull", |
|
687 | b"infinite-push's pull", | |
688 | repo, |
|
|||
689 | ui, |
|
688 | ui, | |
690 | source, |
|
689 | source, | |
691 | default_branches=opts.get(b'branch'), |
|
|||
692 | ) |
|
690 | ) | |
693 |
|
691 | |||
694 | scratchbookmarks = {} |
|
692 | scratchbookmarks = {} | |
@@ -709,7 +707,7 b' def _pull(orig, ui, repo, source=b"defau' | |||||
709 | bookmarks.append(bookmark) |
|
707 | bookmarks.append(bookmark) | |
710 |
|
708 | |||
711 | if scratchbookmarks: |
|
709 | if scratchbookmarks: | |
712 |
other = hg.peer(repo, opts, |
|
710 | other = hg.peer(repo, opts, path) | |
713 | try: |
|
711 | try: | |
714 | fetchedbookmarks = other.listkeyspatterns( |
|
712 | fetchedbookmarks = other.listkeyspatterns( | |
715 | b'bookmarks', patterns=scratchbookmarks |
|
713 | b'bookmarks', patterns=scratchbookmarks | |
@@ -734,14 +732,14 b' def _pull(orig, ui, repo, source=b"defau' | |||||
734 | try: |
|
732 | try: | |
735 | # Remote scratch bookmarks will be deleted because remotenames doesn't |
|
733 | # Remote scratch bookmarks will be deleted because remotenames doesn't | |
736 | # know about them. Let's save it before pull and restore after |
|
734 | # know about them. Let's save it before pull and restore after | |
737 |
remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, |
|
735 | remotescratchbookmarks = _readscratchremotebookmarks(ui, repo, path.loc) | |
738 |
result = orig(ui, repo, |
|
736 | result = orig(ui, repo, path.loc, **pycompat.strkwargs(opts)) | |
739 | # TODO(stash): race condition is possible |
|
737 | # TODO(stash): race condition is possible | |
740 | # if scratch bookmarks was updated right after orig. |
|
738 | # if scratch bookmarks was updated right after orig. | |
741 | # But that's unlikely and shouldn't be harmful. |
|
739 | # But that's unlikely and shouldn't be harmful. | |
742 | if common.isremotebooksenabled(ui): |
|
740 | if common.isremotebooksenabled(ui): | |
743 | remotescratchbookmarks.update(scratchbookmarks) |
|
741 | remotescratchbookmarks.update(scratchbookmarks) | |
744 |
_saveremotebookmarks(repo, remotescratchbookmarks, |
|
742 | _saveremotebookmarks(repo, remotescratchbookmarks, path.loc) | |
745 | else: |
|
743 | else: | |
746 | _savelocalbookmarks(repo, scratchbookmarks) |
|
744 | _savelocalbookmarks(repo, scratchbookmarks) | |
747 | return result |
|
745 | return result |
General Comments 0
You need to be logged in to leave comments.
Login now