Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 43117:8ff1ecfadcd1
cleanup: join string literals that are already on one line
Thanks to Kyle for noticing this and for providing the regular
expression to run on the codebase.
This patch has been reviewed by the test suite and they approved of
it.
# skip-blame: fallout from mass reformatting
Differential Revision: https://phab.mercurial-scm.org/D7028
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 08 Oct 2019 15:06:18 -0700 |
parents | d783f945a701 |
children | 81efc4a295e7 |
comparison
equal
deleted
inserted
replaced
43116:defabf63e969 | 43117:8ff1ecfadcd1 |
---|---|
221 self.close() | 221 self.close() |
222 | 222 |
223 def callcommand(self, command, args): | 223 def callcommand(self, command, args): |
224 if self._sent: | 224 if self._sent: |
225 raise error.ProgrammingError( | 225 raise error.ProgrammingError( |
226 b'callcommand() cannot be used after ' b'sendcommands()' | 226 b'callcommand() cannot be used after sendcommands()' |
227 ) | 227 ) |
228 | 228 |
229 if self._closed: | 229 if self._closed: |
230 raise error.ProgrammingError( | 230 raise error.ProgrammingError( |
231 b'callcommand() cannot be used after ' b'close()' | 231 b'callcommand() cannot be used after close()' |
232 ) | 232 ) |
233 | 233 |
234 # We don't need to support anything fancy. Just call the named | 234 # We don't need to support anything fancy. Just call the named |
235 # method on the peer and return a resolved future. | 235 # method on the peer and return a resolved future. |
236 fn = getattr(self._peer, pycompat.sysstr(command)) | 236 fn = getattr(self._peer, pycompat.sysstr(command)) |
341 | 341 |
342 def pushkey(self, namespace, key, old, new): | 342 def pushkey(self, namespace, key, old, new): |
343 return self._repo.pushkey(namespace, key, old, new) | 343 return self._repo.pushkey(namespace, key, old, new) |
344 | 344 |
345 def stream_out(self): | 345 def stream_out(self): |
346 raise error.Abort( | 346 raise error.Abort(_(b'cannot perform stream clone against local peer')) |
347 _(b'cannot perform stream clone against local ' b'peer') | |
348 ) | |
349 | 347 |
350 def unbundle(self, bundle, heads, url): | 348 def unbundle(self, bundle, heads, url): |
351 """apply a bundle on a repo | 349 """apply a bundle on a repo |
352 | 350 |
353 This function handles the repo locking itself.""" | 351 This function handles the repo locking itself.""" |
566 | 564 |
567 sharedvfs = vfsmod.vfs(sharedpath, realpath=True) | 565 sharedvfs = vfsmod.vfs(sharedpath, realpath=True) |
568 | 566 |
569 if not sharedvfs.exists(): | 567 if not sharedvfs.exists(): |
570 raise error.RepoError( | 568 raise error.RepoError( |
571 _(b'.hg/sharedpath points to nonexistent ' b'directory %s') | 569 _(b'.hg/sharedpath points to nonexistent directory %s') |
572 % sharedvfs.base | 570 % sharedvfs.base |
573 ) | 571 ) |
574 | 572 |
575 features.add(repository.REPO_FEATURE_SHARED_STORAGE) | 573 features.add(repository.REPO_FEATURE_SHARED_STORAGE) |
576 | 574 |
1451 return node | 1449 return node |
1452 except error.LookupError: | 1450 except error.LookupError: |
1453 if not self._dirstatevalidatewarned: | 1451 if not self._dirstatevalidatewarned: |
1454 self._dirstatevalidatewarned = True | 1452 self._dirstatevalidatewarned = True |
1455 self.ui.warn( | 1453 self.ui.warn( |
1456 _(b"warning: ignoring unknown" b" working parent %s!\n") | 1454 _(b"warning: ignoring unknown working parent %s!\n") |
1457 % short(node) | 1455 % short(node) |
1458 ) | 1456 ) |
1459 return nullid | 1457 return nullid |
1460 | 1458 |
1461 @storecache(narrowspec.FILENAME) | 1459 @storecache(narrowspec.FILENAME) |
2300 b'repository tip rolled back to revision %d' | 2298 b'repository tip rolled back to revision %d' |
2301 b' (undo %s: %s)\n' | 2299 b' (undo %s: %s)\n' |
2302 ) % (oldtip, desc, detail) | 2300 ) % (oldtip, desc, detail) |
2303 else: | 2301 else: |
2304 msg = _( | 2302 msg = _( |
2305 b'repository tip rolled back to revision %d' b' (undo %s)\n' | 2303 b'repository tip rolled back to revision %d (undo %s)\n' |
2306 ) % (oldtip, desc) | 2304 ) % (oldtip, desc) |
2307 except IOError: | 2305 except IOError: |
2308 msg = _(b'rolling back unknown transaction\n') | 2306 msg = _(b'rolling back unknown transaction\n') |
2309 desc = None | 2307 desc = None |
2310 | 2308 |
2365 ) | 2363 ) |
2366 % parents | 2364 % parents |
2367 ) | 2365 ) |
2368 else: | 2366 else: |
2369 ui.status( | 2367 ui.status( |
2370 _(b'working directory now based on ' b'revision %d\n') | 2368 _(b'working directory now based on revision %d\n') % parents |
2371 % parents | |
2372 ) | 2369 ) |
2373 mergemod.mergestate.clean(self, self[b'.'].node()) | 2370 mergemod.mergestate.clean(self, self[b'.'].node()) |
2374 | 2371 |
2375 # TODO: if we know which new heads may result from this rollback, pass | 2372 # TODO: if we know which new heads may result from this rollback, pass |
2376 # them to destroy(), which will prevent the branchhead cache from being | 2373 # them to destroy(), which will prevent the branchhead cache from being |
3598 | 3595 |
3599 unknownopts = filterknowncreateopts(ui, createopts) | 3596 unknownopts = filterknowncreateopts(ui, createopts) |
3600 | 3597 |
3601 if not isinstance(unknownopts, dict): | 3598 if not isinstance(unknownopts, dict): |
3602 raise error.ProgrammingError( | 3599 raise error.ProgrammingError( |
3603 b'filterknowncreateopts() did not return ' b'a dict' | 3600 b'filterknowncreateopts() did not return a dict' |
3604 ) | 3601 ) |
3605 | 3602 |
3606 if unknownopts: | 3603 if unknownopts: |
3607 raise error.Abort( | 3604 raise error.Abort( |
3608 _( | 3605 _( |
3685 def __getattribute__(self, item): | 3682 def __getattribute__(self, item): |
3686 if item == r'close': | 3683 if item == r'close': |
3687 return object.__getattribute__(self, item) | 3684 return object.__getattribute__(self, item) |
3688 | 3685 |
3689 raise error.ProgrammingError( | 3686 raise error.ProgrammingError( |
3690 b'repo instances should not be used ' b'after unshare' | 3687 b'repo instances should not be used after unshare' |
3691 ) | 3688 ) |
3692 | 3689 |
3693 def close(self): | 3690 def close(self): |
3694 pass | 3691 pass |
3695 | 3692 |