equal
deleted
inserted
replaced
4405 |
4405 |
4406 |
4406 |
4407 try: |
4407 try: |
4408 try: |
4408 try: |
4409 wlock = repo.wlock() |
4409 wlock = repo.wlock() |
4410 dsguard = cmdutil.dirstateguard(repo, 'import') |
|
4411 if not opts.get('no_commit'): |
4410 if not opts.get('no_commit'): |
4412 lock = repo.lock() |
4411 lock = repo.lock() |
4413 tr = repo.transaction('import') |
4412 tr = repo.transaction('import') |
|
4413 else: |
|
4414 dsguard = cmdutil.dirstateguard(repo, 'import') |
4414 parents = repo.parents() |
4415 parents = repo.parents() |
4415 for patchurl in patches: |
4416 for patchurl in patches: |
4416 if patchurl == '-': |
4417 if patchurl == '-': |
4417 ui.status(_('applying patch from stdin\n')) |
4418 ui.status(_('applying patch from stdin\n')) |
4418 patchfile = ui.fin |
4419 patchfile = ui.fin |
4446 |
4447 |
4447 if tr: |
4448 if tr: |
4448 tr.close() |
4449 tr.close() |
4449 if msgs: |
4450 if msgs: |
4450 repo.savecommitmessage('\n* * *\n'.join(msgs)) |
4451 repo.savecommitmessage('\n* * *\n'.join(msgs)) |
4451 dsguard.close() |
4452 if dsguard: |
|
4453 dsguard.close() |
4452 return ret |
4454 return ret |
4453 finally: |
4455 finally: |
4454 # TODO: get rid of this meaningless try/finally enclosing. |
4456 # TODO: get rid of this meaningless try/finally enclosing. |
4455 # this is kept only to reduce changes in a patch. |
4457 # this is kept only to reduce changes in a patch. |
4456 pass |
4458 pass |