4080 if result == 0: |
4080 if result == 0: |
4081 return not result |
4081 return not result |
4082 finally: |
4082 finally: |
4083 del repo._subtoppath |
4083 del repo._subtoppath |
4084 |
4084 |
4085 pushvars = opts.get('pushvars') |
4085 opargs = dict(opts.get('opargs', {})) # copy opargs since we may mutate it |
4086 if pushvars: |
4086 opargs.setdefault('pushvars', []).extend(opts.get('pushvars', [])) |
4087 shellvars = {} |
|
4088 for raw in pushvars: |
|
4089 if '=' not in raw: |
|
4090 msg = ("unable to parse variable '%s', should follow " |
|
4091 "'KEY=VALUE' or 'KEY=' format") |
|
4092 raise error.Abort(msg % raw) |
|
4093 k, v = raw.split('=', 1) |
|
4094 shellvars[k] = v |
|
4095 |
|
4096 repo._shellvars = shellvars |
|
4097 |
4087 |
4098 pushop = exchange.push(repo, other, opts.get('force'), revs=revs, |
4088 pushop = exchange.push(repo, other, opts.get('force'), revs=revs, |
4099 newbranch=opts.get('new_branch'), |
4089 newbranch=opts.get('new_branch'), |
4100 bookmarks=opts.get('bookmark', ()), |
4090 bookmarks=opts.get('bookmark', ()), |
4101 opargs=opts.get('opargs')) |
4091 opargs=opargs) |
4102 |
|
4103 if pushvars: |
|
4104 del repo._shellvars |
|
4105 |
4092 |
4106 result = not pushop.cgresult |
4093 result = not pushop.cgresult |
4107 |
4094 |
4108 if pushop.bkresult is not None: |
4095 if pushop.bkresult is not None: |
4109 if pushop.bkresult == 2: |
4096 if pushop.bkresult == 2: |