Mercurial > hg
comparison mercurial/phases.py @ 51578:231a92eb1936
phases: more compact error handling in analyzeremotephases
using an intermediate variable result in more readable code, so let us use it.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 05 Apr 2024 11:17:25 +0200 |
parents | 4ee50d98d35c |
children | 87655e6dc108 |
comparison
equal
deleted
inserted
replaced
51577:b5d494f7d28a | 51578:231a92eb1936 |
---|---|
1112 continue | 1112 continue |
1113 node = bin(nhex) | 1113 node = bin(nhex) |
1114 phase = int(phase) | 1114 phase = int(phase) |
1115 if phase == public: | 1115 if phase == public: |
1116 if node != repo.nullid: | 1116 if node != repo.nullid: |
1117 repo.ui.warn( | 1117 msg = _(b'ignoring inconsistent public root from remote: %s\n') |
1118 _( | 1118 repo.ui.warn(msg % nhex) |
1119 b'ignoring inconsistent public root' | |
1120 b' from remote: %s\n' | |
1121 ) | |
1122 % nhex | |
1123 ) | |
1124 elif phase == draft: | 1119 elif phase == draft: |
1125 if has_node(node): | 1120 if has_node(node): |
1126 draftroots.append(node) | 1121 draftroots.append(node) |
1127 else: | 1122 else: |
1128 repo.ui.warn( | 1123 msg = _(b'ignoring unexpected root from remote: %i %s\n') |
1129 _(b'ignoring unexpected root from remote: %i %s\n') | 1124 repo.ui.warn(msg % (phase, nhex)) |
1130 % (phase, nhex) | |
1131 ) | |
1132 # compute heads | 1125 # compute heads |
1133 publicheads = newheads(repo, subset, draftroots) | 1126 publicheads = newheads(repo, subset, draftroots) |
1134 return publicheads, draftroots | 1127 return publicheads, draftroots |
1135 | 1128 |
1136 | 1129 |