diff options
author | Chirayu Desai <cdesai@cyanogenmod.org> | 2013-06-11 14:18:46 +0530 |
---|---|---|
committer | Chirayu Desai <cdesai@cyanogenmod.org> | 2013-06-11 14:18:58 +0530 |
commit | a892b1006b5b7193262f3783b9678e2c76978a9b (patch) | |
tree | b5834be69d2578788a314e269f684bc86d8d8e6b /subcmds/sync.py | |
parent | ef668c92c2c87c45df02bf1609a89e4479bbb30c (diff) | |
download | git-repo-a892b1006b5b7193262f3783b9678e2c76978a9b.tar.gz |
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
53a6c5d93a8ba708208826dab64c55fe97f06d0b
Change-Id: I57086670f3589beea8461ce0344f6ec47ab85b7b
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 930211c1..ff0cf3aa 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -487,6 +487,8 @@ later is required to fix a server side protocol bug. | |||
487 | if opt.manifest_name: | 487 | if opt.manifest_name: |
488 | self.manifest.Override(opt.manifest_name) | 488 | self.manifest.Override(opt.manifest_name) |
489 | 489 | ||
490 | manifest_name = opt.manifest_name | ||
491 | |||
490 | if opt.smart_sync or opt.smart_tag: | 492 | if opt.smart_sync or opt.smart_tag: |
491 | if not self.manifest.manifest_server: | 493 | if not self.manifest.manifest_server: |
492 | print('error: cannot smart sync: no manifest server defined in ' | 494 | print('error: cannot smart sync: no manifest server defined in ' |
@@ -526,7 +528,6 @@ later is required to fix a server side protocol bug. | |||
526 | (username, password), | 528 | (username, password), |
527 | 1) | 529 | 1) |
528 | 530 | ||
529 | manifest_name = opt.manifest_name | ||
530 | try: | 531 | try: |
531 | server = xmlrpc.client.Server(manifest_server) | 532 | server = xmlrpc.client.Server(manifest_server) |
532 | if opt.smart_sync: | 533 | if opt.smart_sync: |