|
6 | 6 |
|
7 | 7 | __all__ = ( 'ObjectDBR', 'ObjectDBW', 'RootPathDB', 'CompoundDB', 'CachingDB', |
8 | 8 | 'TransportDB', 'ConfigurationMixin', 'RepositoryPathsMixin', |
9 | | - 'RefSpec', 'FetchInfo', 'PushInfo', 'ReferencesMixin') |
| 9 | + 'RefSpec', 'FetchInfo', 'PushInfo', 'ReferencesMixin', 'SubmoduleDB') |
10 | 10 |
|
11 | 11 |
|
12 | 12 | class ObjectDBR(object): |
@@ -151,7 +151,7 @@ def __init__(self, root_path): |
151 | 151 | access.""" |
152 | 152 | super(RootPathDB, self).__init__(root_path) |
153 | 153 |
|
154 | | - #{ Interface |
| 154 | + #{ Interface |
155 | 155 | def root_path(self): |
156 | 156 | """:return: path at which this db operates""" |
157 | 157 | raise NotImplementedError() |
@@ -390,33 +390,60 @@ def _initialize(self, path): |
390 | 390 | raise NotImplementedError() |
391 | 391 | #} end subclass interface |
392 | 392 |
|
| 393 | + #{ Object Interface |
| 394 | + |
| 395 | + def __eq__(self, rhs): |
| 396 | + raise NotImplementedError() |
| 397 | + |
| 398 | + def __ne__(self, rhs): |
| 399 | + raise NotImplementedError() |
| 400 | + |
| 401 | + def __hash__(self): |
| 402 | + raise NotImplementedError() |
| 403 | + |
| 404 | + def __repr__(self): |
| 405 | + raise NotImplementedError() |
| 406 | + |
| 407 | + #} END object interface |
| 408 | + |
393 | 409 | #{ Interface |
394 | 410 |
|
| 411 | + @property |
395 | 412 | def is_bare(self): |
396 | 413 | """:return: True if this is a bare repository |
397 | 414 | :note: this value is cached upon initialization""" |
398 | 415 | raise NotImplementedError() |
399 | 416 |
|
400 | | - def git_path(self): |
| 417 | + @property |
| 418 | + def git_dir(self): |
401 | 419 | """:return: path to directory containing this actual git repository (which |
402 | 420 | in turn provides access to objects and references""" |
403 | 421 | raise NotImplementedError() |
404 | 422 |
|
405 | | - def working_tree_path(self): |
| 423 | + @property |
| 424 | + def working_tree_dir(self): |
406 | 425 | """:return: path to directory containing the working tree checkout of our |
407 | 426 | git repository. |
408 | 427 | :raise AssertionError: If this is a bare repository""" |
409 | 428 | raise NotImplementedError() |
410 | 429 |
|
411 | | - def objects_path(self): |
| 430 | + @property |
| 431 | + def objects_dir(self): |
412 | 432 | """:return: path to the repository's objects directory""" |
413 | 433 | raise NotImplementedError() |
414 | 434 |
|
| 435 | + @property |
415 | 436 | def working_dir(self): |
416 | 437 | """:return: working directory of the git process or related tools, being |
417 | | - either the working_tree_path if available or the git_path""" |
| 438 | + either the working_tree_dir if available or the git_path""" |
418 | 439 | raise NotImplementedError() |
419 | | - |
| 440 | + |
| 441 | + @property |
| 442 | + def description(self): |
| 443 | + """:return: description text associated with this repository or set the |
| 444 | + description.""" |
| 445 | + raise NotImplementedError() |
| 446 | + |
420 | 447 | #} END interface |
421 | 448 |
|
422 | 449 |
|
@@ -465,5 +492,43 @@ def config_writer(self, config_level="repository"): |
465 | 492 | repository = configuration file for this repostory only""" |
466 | 493 | raise NotImplementedError() |
467 | 494 |
|
| 495 | + |
468 | 496 | #} END interface |
469 | 497 |
|
| 498 | + |
| 499 | +class SubmoduleDB(object): |
| 500 | + """Interface providing access to git repository submodules. |
| 501 | + The actual implementation is found in the Submodule object type, which is |
| 502 | + currently only available in one implementation.""" |
| 503 | + |
| 504 | + @property |
| 505 | + def submodules(self): |
| 506 | + """ |
| 507 | + :return: git.IterableList(Submodule, ...) of direct submodules |
| 508 | + available from the current head""" |
| 509 | + raise NotImplementedError() |
| 510 | + |
| 511 | + def submodule(self, name): |
| 512 | + """ :return: Submodule with the given name |
| 513 | + :raise ValueError: If no such submodule exists""" |
| 514 | + raise NotImplementedError() |
| 515 | + |
| 516 | + def create_submodule(self, *args, **kwargs): |
| 517 | + """Create a new submodule |
| 518 | + |
| 519 | + :note: See the documentation of Submodule.add for a description of the |
| 520 | + applicable parameters |
| 521 | + :return: created submodules""" |
| 522 | + raise NotImplementedError() |
| 523 | + |
| 524 | + def iter_submodules(self, *args, **kwargs): |
| 525 | + """An iterator yielding Submodule instances, see Traversable interface |
| 526 | + for a description of args and kwargs |
| 527 | + :return: Iterator""" |
| 528 | + raise NotImplementedError() |
| 529 | + |
| 530 | + def submodule_update(self, *args, **kwargs): |
| 531 | + """Update the submodules, keeping the repository consistent as it will |
| 532 | + take the previous state into consideration. For more information, please |
| 533 | + see the documentation of RootModule.update""" |
| 534 | + raise NotImplementedError() |
0 commit comments