sync: assign manifest_name earlier

* manifest_name was never set if opt.smart_sync or opt.smart_tag is used.
* Set it earlier, so that the code handles it correctly when it is None.
* An UnboundLocalError is raised if running `repo sync` without any options:
  local variable 'manifest_name' referenced before assignment
* This fixes the above regression caused by commit
  53a6c5d93a

Change-Id: I57086670f3589beea8461ce0344f6ec47ab85b7b
This commit is contained in:
Chirayu Desai 2013-06-11 14:18:46 +05:30
parent ef668c92c2
commit a892b1006b

View File

@ -487,6 +487,8 @@ later is required to fix a server side protocol bug.
if opt.manifest_name:
self.manifest.Override(opt.manifest_name)
manifest_name = opt.manifest_name
if opt.smart_sync or opt.smart_tag:
if not self.manifest.manifest_server:
print('error: cannot smart sync: no manifest server defined in '
@ -526,7 +528,6 @@ later is required to fix a server side protocol bug.
(username, password),
1)
manifest_name = opt.manifest_name
try:
server = xmlrpc.client.Server(manifest_server)
if opt.smart_sync: