##// END OF EJS Templates
push: move discovery in its own function...
Pierre-Yves David -
r20466:233623d5 default
parent child Browse files
Show More
@@ -78,7 +78,6 b' def push(repo, remote, force=False, revs'
78 78
79 79 if not pushop.remote.canpush():
80 80 raise util.Abort(_("destination does not support push"))
81 unfi = pushop.repo.unfiltered()
82 81 # get local lock as we might write phase data
83 82 locallock = None
84 83 try:
@@ -100,17 +99,7 b' def push(repo, remote, force=False, revs'
100 99 if not unbundle:
101 100 lock = pushop.remote.lock()
102 101 try:
103 # discovery
104 fci = discovery.findcommonincoming
105 commoninc = fci(unfi, pushop.remote, force=pushop.force)
106 common, inc, remoteheads = commoninc
107 fco = discovery.findcommonoutgoing
108 outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
109 commoninc=commoninc, force=pushop.force)
110 pushop.outgoing = outgoing
111 pushop.remoteheads = remoteheads
112 pushop.incoming = inc
113
102 _pushdiscovery(pushop)
114 103 if _pushcheckoutgoing(pushop):
115 104 _pushchangeset(pushop)
116 105 _pushsyncphase(pushop)
@@ -125,6 +114,19 b' def push(repo, remote, force=False, revs'
125 114 _pushbookmark(pushop)
126 115 return pushop.ret
127 116
117 def _pushdiscovery(pushop):
118 # discovery
119 unfi = pushop.repo.unfiltered()
120 fci = discovery.findcommonincoming
121 commoninc = fci(unfi, pushop.remote, force=pushop.force)
122 common, inc, remoteheads = commoninc
123 fco = discovery.findcommonoutgoing
124 outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
125 commoninc=commoninc, force=pushop.force)
126 pushop.outgoing = outgoing
127 pushop.remoteheads = remoteheads
128 pushop.incoming = inc
129
128 130 def _pushcheckoutgoing(pushop):
129 131 outgoing = pushop.outgoing
130 132 unfi = pushop.repo.unfiltered()
General Comments 0
You need to be logged in to leave comments. Login now