Show More
@@ -40,7 +40,6 b' from . import (' | |||
|
40 | 40 | hbisect, |
|
41 | 41 | help, |
|
42 | 42 | hg, |
|
43 | lock as lockmod, | |
|
44 | 43 | logcmdutil, |
|
45 | 44 | merge as mergemod, |
|
46 | 45 | obsolete, |
@@ -67,8 +66,6 b' from .utils import (' | |||
|
67 | 66 | stringutil, |
|
68 | 67 | ) |
|
69 | 68 | |
|
70 | release = lockmod.release | |
|
71 | ||
|
72 | 69 | table = {} |
|
73 | 70 | table.update(debugcommandsmod.command._table) |
|
74 | 71 | |
@@ -3111,22 +3108,24 b' def import_(ui, repo, patch1=None, *patc' | |||
|
3111 | 3108 | raise error.Abort(_('cannot use --exact with --prefix')) |
|
3112 | 3109 | |
|
3113 | 3110 | base = opts["base"] |
|
3114 | dsguard = lock = tr = None | |
|
3115 | 3111 | msgs = [] |
|
3116 | 3112 | ret = 0 |
|
3117 | 3113 | |
|
3118 | 3114 | with repo.wlock(): |
|
3119 |
|
|
|
3120 | if update: | |
|
3121 | cmdutil.checkunfinished(repo) | |
|
3122 | if (exact or not opts.get('force')): | |
|
3123 | cmdutil.bailifchanged(repo) | |
|
3124 | ||
|
3125 | if not opts.get('no_commit'): | |
|
3126 | lock = repo.lock() | |
|
3127 | tr = repo.transaction('import') | |
|
3128 |
|
|
|
3129 | dsguard = dirstateguard.dirstateguard(repo, 'import') | |
|
3115 | if update: | |
|
3116 | cmdutil.checkunfinished(repo) | |
|
3117 | if (exact or not opts.get('force')): | |
|
3118 | cmdutil.bailifchanged(repo) | |
|
3119 | ||
|
3120 | if not opts.get('no_commit'): | |
|
3121 | lock = repo.lock | |
|
3122 | tr = lambda: repo.transaction('import') | |
|
3123 | dsguard = util.nullcontextmanager | |
|
3124 | else: | |
|
3125 | lock = util.nullcontextmanager | |
|
3126 | tr = util.nullcontextmanager | |
|
3127 | dsguard = lambda: dirstateguard.dirstateguard(repo, 'import') | |
|
3128 | with lock(), tr(), dsguard(): | |
|
3130 | 3129 | parents = repo[None].parents() |
|
3131 | 3130 | for patchurl in patches: |
|
3132 | 3131 | if patchurl == '-': |
@@ -3162,17 +3161,9 b' def import_(ui, repo, patch1=None, *patc' | |||
|
3162 | 3161 | if not haspatch: |
|
3163 | 3162 | raise error.Abort(_('%s: no diffs found') % patchurl) |
|
3164 | 3163 | |
|
3165 | if tr: | |
|
3166 | tr.close() | |
|
3167 | 3164 | if msgs: |
|
3168 | 3165 | repo.savecommitmessage('\n* * *\n'.join(msgs)) |
|
3169 | if dsguard: | |
|
3170 | dsguard.close() | |
|
3171 | return ret | |
|
3172 | finally: | |
|
3173 | if tr: | |
|
3174 | tr.release() | |
|
3175 | release(lock, dsguard) | |
|
3166 | return ret | |
|
3176 | 3167 | |
|
3177 | 3168 | @command('incoming|in', |
|
3178 | 3169 | [('f', 'force', None, |
General Comments 0
You need to be logged in to leave comments.
Login now