##// END OF EJS Templates
push: move outgoing check logic in its own function...
Pierre-Yves David -
r20465:170f7106 default
parent child Browse files
Show More
@@ -111,39 +111,7 b' def push(repo, remote, force=False, revs'
111 pushop.remoteheads = remoteheads
111 pushop.remoteheads = remoteheads
112 pushop.incoming = inc
112 pushop.incoming = inc
113
113
114
114 if _pushcheckoutgoing(pushop):
115 if not outgoing.missing:
116 # nothing to push
117 scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded)
118 else:
119 # something to push
120 if not pushop.force:
121 # if repo.obsstore == False --> no obsolete
122 # then, save the iteration
123 if unfi.obsstore:
124 # this message are here for 80 char limit reason
125 mso = _("push includes obsolete changeset: %s!")
126 mst = "push includes %s changeset: %s!"
127 # plain versions for i18n tool to detect them
128 _("push includes unstable changeset: %s!")
129 _("push includes bumped changeset: %s!")
130 _("push includes divergent changeset: %s!")
131 # If we are to push if there is at least one
132 # obsolete or unstable changeset in missing, at
133 # least one of the missinghead will be obsolete or
134 # unstable. So checking heads only is ok
135 for node in outgoing.missingheads:
136 ctx = unfi[node]
137 if ctx.obsolete():
138 raise util.Abort(mso % ctx)
139 elif ctx.troubled():
140 raise util.Abort(_(mst)
141 % (ctx.troubles()[0],
142 ctx))
143 newbm = pushop.ui.configlist('bookmarks', 'pushing')
144 discovery.checkheads(unfi, pushop.remote, outgoing,
145 remoteheads, pushop.newbranch,
146 bool(pushop.incoming), newbm)
147 _pushchangeset(pushop)
115 _pushchangeset(pushop)
148 _pushsyncphase(pushop)
116 _pushsyncphase(pushop)
149 _pushobsolete(pushop)
117 _pushobsolete(pushop)
@@ -157,6 +125,45 b' def push(repo, remote, force=False, revs'
157 _pushbookmark(pushop)
125 _pushbookmark(pushop)
158 return pushop.ret
126 return pushop.ret
159
127
128 def _pushcheckoutgoing(pushop):
129 outgoing = pushop.outgoing
130 unfi = pushop.repo.unfiltered()
131 if not outgoing.missing:
132 # nothing to push
133 scmutil.nochangesfound(unfi.ui, unfi, outgoing.excluded)
134 return False
135 # something to push
136 if not pushop.force:
137 # if repo.obsstore == False --> no obsolete
138 # then, save the iteration
139 if unfi.obsstore:
140 # this message are here for 80 char limit reason
141 mso = _("push includes obsolete changeset: %s!")
142 mst = "push includes %s changeset: %s!"
143 # plain versions for i18n tool to detect them
144 _("push includes unstable changeset: %s!")
145 _("push includes bumped changeset: %s!")
146 _("push includes divergent changeset: %s!")
147 # If we are to push if there is at least one
148 # obsolete or unstable changeset in missing, at
149 # least one of the missinghead will be obsolete or
150 # unstable. So checking heads only is ok
151 for node in outgoing.missingheads:
152 ctx = unfi[node]
153 if ctx.obsolete():
154 raise util.Abort(mso % ctx)
155 elif ctx.troubled():
156 raise util.Abort(_(mst)
157 % (ctx.troubles()[0],
158 ctx))
159 newbm = pushop.ui.configlist('bookmarks', 'pushing')
160 discovery.checkheads(unfi, pushop.remote, outgoing,
161 pushop.remoteheads,
162 pushop.newbranch,
163 bool(pushop.incoming),
164 newbm)
165 return True
166
160 def _pushchangeset(pushop):
167 def _pushchangeset(pushop):
161 """Make the actual push of changeset bundle to remote repo"""
168 """Make the actual push of changeset bundle to remote repo"""
162 outgoing = pushop.outgoing
169 outgoing = pushop.outgoing
General Comments 0
You need to be logged in to leave comments. Login now