##// END OF EJS Templates
Mercurial: commitctx, properly set new commits phase based on publishing flag
marcink -
r659:c518c95a default
parent child Browse files
Show More
@@ -202,7 +202,15 b' class HgRemote(object):'
202 self, wire, message, parents, commit_time, commit_timezone,
202 self, wire, message, parents, commit_time, commit_timezone,
203 user, files, extra, removed, updated):
203 user, files, extra, removed, updated):
204
204
205 def _filectxfn(_repo, memctx, path):
205 repo = self._factory.repo(wire)
206 baseui = self._factory._create_config(wire['config'])
207 publishing = baseui.configbool('phases', 'publish')
208 if publishing:
209 new_commit = 'public'
210 else:
211 new_commit = 'draft'
212
213 def _filectxfn(_repo, ctx, path):
206 """
214 """
207 Marks given path as added/changed/removed in a given _repo. This is
215 Marks given path as added/changed/removed in a given _repo. This is
208 for internal mercurial commit function.
216 for internal mercurial commit function.
@@ -218,7 +226,7 b' class HgRemote(object):'
218 if node['path'] == path:
226 if node['path'] == path:
219 return memfilectx(
227 return memfilectx(
220 _repo,
228 _repo,
221 changectx=memctx,
229 changectx=ctx,
222 path=node['path'],
230 path=node['path'],
223 data=node['content'],
231 data=node['content'],
224 islink=False,
232 islink=False,
@@ -229,7 +237,7 b' class HgRemote(object):'
229 "Given path haven't been marked as added, "
237 "Given path haven't been marked as added, "
230 "changed or removed (%s)" % path)
238 "changed or removed (%s)" % path)
231
239
232 repo = self._factory.repo(wire)
240 with repo.ui.configoverride({('phases', 'new-commit'): new_commit}):
233
241
234 commit_ctx = memctx(
242 commit_ctx = memctx(
235 repo=repo,
243 repo=repo,
General Comments 0
You need to be logged in to leave comments. Login now