Mercurial > hg
comparison mercurial/exchange.py @ 22653:d94f5bec9c8e
pull: perform the todostep inside functions handling old way of pulling
This matches what is done during push.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 27 Sep 2014 01:34:02 -0700 |
parents | b901645a8784 |
children | 02e0a574bcd3 |
comparison
equal
deleted
inserted
replaced
22652:15bc5ea297f5 | 22653:d94f5bec9c8e |
---|---|
850 try: | 850 try: |
851 _pulldiscovery(pullop) | 851 _pulldiscovery(pullop) |
852 if (pullop.repo.ui.configbool('experimental', 'bundle2-exp', False) | 852 if (pullop.repo.ui.configbool('experimental', 'bundle2-exp', False) |
853 and pullop.remote.capable('bundle2-exp')): | 853 and pullop.remote.capable('bundle2-exp')): |
854 _pullbundle2(pullop) | 854 _pullbundle2(pullop) |
855 if 'changegroup' in pullop.todosteps: | 855 _pullchangeset(pullop) |
856 _pullchangeset(pullop) | 856 _pullphase(pullop) |
857 if 'phases' in pullop.todosteps: | 857 _pullobsolete(pullop) |
858 _pullphase(pullop) | |
859 if 'obsmarkers' in pullop.todosteps: | |
860 _pullobsolete(pullop) | |
861 pullop.closetransaction() | 858 pullop.closetransaction() |
862 finally: | 859 finally: |
863 pullop.releasetransaction() | 860 pullop.releasetransaction() |
864 lock.release() | 861 lock.release() |
865 bookmod.updatefromremote(repo.ui, repo, remotebookmarks, remote.url()) | 862 bookmod.updatefromremote(repo.ui, repo, remotebookmarks, remote.url()) |
938 def _pullchangeset(pullop): | 935 def _pullchangeset(pullop): |
939 """pull changeset from unbundle into the local repo""" | 936 """pull changeset from unbundle into the local repo""" |
940 # We delay the open of the transaction as late as possible so we | 937 # We delay the open of the transaction as late as possible so we |
941 # don't open transaction for nothing or you break future useful | 938 # don't open transaction for nothing or you break future useful |
942 # rollback call | 939 # rollback call |
940 if 'changegroup' not in pullop.todosteps: | |
941 return | |
943 pullop.todosteps.remove('changegroup') | 942 pullop.todosteps.remove('changegroup') |
944 if not pullop.fetch: | 943 if not pullop.fetch: |
945 pullop.repo.ui.status(_("no changes found\n")) | 944 pullop.repo.ui.status(_("no changes found\n")) |
946 pullop.cgresult = 0 | 945 pullop.cgresult = 0 |
947 return | 946 return |
967 pullop.cgresult = changegroup.addchangegroup(pullop.repo, cg, 'pull', | 966 pullop.cgresult = changegroup.addchangegroup(pullop.repo, cg, 'pull', |
968 pullop.remote.url()) | 967 pullop.remote.url()) |
969 | 968 |
970 def _pullphase(pullop): | 969 def _pullphase(pullop): |
971 # Get remote phases data from remote | 970 # Get remote phases data from remote |
971 if 'phases' not in pullop.todosteps: | |
972 return | |
972 remotephases = pullop.remote.listkeys('phases') | 973 remotephases = pullop.remote.listkeys('phases') |
973 _pullapplyphases(pullop, remotephases) | 974 _pullapplyphases(pullop, remotephases) |
974 | 975 |
975 def _pullapplyphases(pullop, remotephases): | 976 def _pullapplyphases(pullop, remotephases): |
976 """apply phase movement from observed remote state""" | 977 """apply phase movement from observed remote state""" |
1011 The `gettransaction` is function that return the pull transaction, creating | 1012 The `gettransaction` is function that return the pull transaction, creating |
1012 one if necessary. We return the transaction to inform the calling code that | 1013 one if necessary. We return the transaction to inform the calling code that |
1013 a new transaction have been created (when applicable). | 1014 a new transaction have been created (when applicable). |
1014 | 1015 |
1015 Exists mostly to allow overriding for experimentation purpose""" | 1016 Exists mostly to allow overriding for experimentation purpose""" |
1017 if 'obsmarkers' not in pullop.todosteps: | |
1018 return | |
1016 pullop.todosteps.remove('obsmarkers') | 1019 pullop.todosteps.remove('obsmarkers') |
1017 tr = None | 1020 tr = None |
1018 if obsolete._enabled: | 1021 if obsolete._enabled: |
1019 pullop.repo.ui.debug('fetching remote obsolete markers\n') | 1022 pullop.repo.ui.debug('fetching remote obsolete markers\n') |
1020 remoteobs = pullop.remote.listkeys('obsolete') | 1023 remoteobs = pullop.remote.listkeys('obsolete') |