Show More
@@ -1268,8 +1268,7 b' class localrepository(repo.repository):' | |||
|
1268 | 1268 | parent2=xp2, pending=p) |
|
1269 | 1269 | self.changelog.finalize(trp) |
|
1270 | 1270 | # set the new commit is proper phase |
|
1271 | targetphase = self.ui.configint('phases', 'new-commit', | |
|
1272 | phases.draft) | |
|
1271 | targetphase = phases.newcommitphase(self.ui) | |
|
1273 | 1272 | if targetphase: |
|
1274 | 1273 | # retract boundary do not alter parent changeset. |
|
1275 | 1274 | # if a parent have higher the resulting phase will |
@@ -298,3 +298,20 b' def newheads(repo, heads, roots):' | |||
|
298 | 298 | heads, roots, roots, heads) |
|
299 | 299 | return [c.node() for c in revset] |
|
300 | 300 | |
|
301 | ||
|
302 | def newcommitphase(ui): | |
|
303 | """helper to get the target phase of new commit | |
|
304 | ||
|
305 | Handle all possible values for the phases.new-commit options. | |
|
306 | ||
|
307 | """ | |
|
308 | v = ui.config('phases', 'new-commit', draft) | |
|
309 | try: | |
|
310 | return phasenames.index(v) | |
|
311 | except ValueError: | |
|
312 | try: | |
|
313 | return int(v) | |
|
314 | except ValueError: | |
|
315 | msg = _("phases.new-commit: not a valid phase name ('%s')") | |
|
316 | raise error.ConfigError(msg % v) | |
|
317 |
General Comments 0
You need to be logged in to leave comments.
Login now