Show More
@@ -92,18 +92,6 b' else:' | |||||
92 | # continue the hg process here. |
|
92 | # continue the hg process here. | |
93 | os._exit(returncode) |
|
93 | os._exit(returncode) | |
94 |
|
94 | |||
95 | def runshellcommand(script, env): |
|
|||
96 | ''' |
|
|||
97 | Run a shell command in the background. |
|
|||
98 | This spawns the command and returns before it completes. |
|
|||
99 |
|
||||
100 | Prefer using runbgcommand() instead of this function. This function should |
|
|||
101 | be discouraged in new code. Running commands through a subshell requires |
|
|||
102 | you to be very careful about correctly escaping arguments, and you need to |
|
|||
103 | make sure your command works with both Windows and Unix shells. |
|
|||
104 | ''' |
|
|||
105 | runbgcommand(script, env=env, shell=True) |
|
|||
106 |
|
||||
107 | @contextlib.contextmanager |
|
95 | @contextlib.contextmanager | |
108 | def flock(lockpath, description, timeout=-1): |
|
96 | def flock(lockpath, description, timeout=-1): | |
109 | """A flock based lock object. Currently it is always non-blocking. |
|
97 | """A flock based lock object. Currently it is always non-blocking. |
@@ -49,10 +49,8 b' def backgroundrepack(repo, incremental=T' | |||||
49 | msg = _("(running background incremental repack)\n") |
|
49 | msg = _("(running background incremental repack)\n") | |
50 | if packsonly: |
|
50 | if packsonly: | |
51 | cmd.append('--packsonly') |
|
51 | cmd.append('--packsonly') | |
52 | cmd = ' '.join(map(procutil.shellquote, cmd)) |
|
|||
53 |
|
||||
54 | repo.ui.warn(msg) |
|
52 | repo.ui.warn(msg) | |
55 |
extutil.run |
|
53 | extutil.runbgcommand(cmd, encoding.environ) | |
56 |
|
54 | |||
57 | def fullrepack(repo, options=None): |
|
55 | def fullrepack(repo, options=None): | |
58 | """If ``packsonly`` is True, stores creating only loose objects are skipped. |
|
56 | """If ``packsonly`` is True, stores creating only loose objects are skipped. |
@@ -199,9 +199,7 b' def wraprepo(repo):' | |||||
199 | cmd.append('--repack') |
|
199 | cmd.append('--repack') | |
200 | if revs: |
|
200 | if revs: | |
201 | cmd += ['-r', revs] |
|
201 | cmd += ['-r', revs] | |
202 | cmd = ' '.join(map(procutil.shellquote, cmd)) |
|
202 | extutil.runbgcommand(cmd, encoding.environ) | |
203 |
|
||||
204 | extutil.runshellcommand(cmd, encoding.environ) |
|
|||
205 |
|
203 | |||
206 | def prefetch(self, revs, base=None, pats=None, opts=None): |
|
204 | def prefetch(self, revs, base=None, pats=None, opts=None): | |
207 | """Prefetches all the necessary file revisions for the given revs |
|
205 | """Prefetches all the necessary file revisions for the given revs |
General Comments 0
You need to be logged in to leave comments.
Login now