changeset 50868:fb0f07c64304

pull: avoid referencing a variable before it is initialized If `urlutil.get_pull_paths()` somehow yields nothing, the reference after the loop appears to be a problem. I noticed this because PyCharm flagged (and still flags) the initialization of this inside the loop as somehow unused. I'm not sure why 1 isn't returned directly where it is set to the result of `postincoming()`, but maybe the code is structured this way in anticipation of future work.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 20 Aug 2023 01:49:48 -0400
parents 7ef29f8b723d
children e674941ad4eb
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Aug 20 01:40:50 2023 -0400
+++ b/mercurial/commands.py	Sun Aug 20 01:49:48 2023 -0400
@@ -5458,6 +5458,8 @@
         hint = _(b'use hg pull followed by hg update DEST')
         raise error.InputError(msg, hint=hint)
 
+    update_conflict = None
+
     for path in urlutil.get_pull_paths(repo, ui, sources):
         ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(path.loc))
         ui.flush()