Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 6707:02bad34230a2
localrepo: hide commit() file selection behind workingctx
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 18 Jun 2008 22:52:25 +0200 |
parents | fec6bc978843 |
children | 7566f00a3979 |
comparison
equal
deleted
inserted
replaced
6706:716a1296e182 | 6707:02bad34230a2 |
---|---|
444 | 444 |
445 class workingctx(changectx): | 445 class workingctx(changectx): |
446 """A workingctx object makes access to data related to | 446 """A workingctx object makes access to data related to |
447 the current working directory convenient. | 447 the current working directory convenient. |
448 parents - a pair of parent nodeids, or None to use the dirstate. | 448 parents - a pair of parent nodeids, or None to use the dirstate. |
449 changes - a list of file lists as returned by localrepo.status() | |
450 or None to use the repository status. | |
449 """ | 451 """ |
450 def __init__(self, repo, parents=None): | 452 def __init__(self, repo, parents=None, changes=None): |
451 self._repo = repo | 453 self._repo = repo |
452 self._rev = None | 454 self._rev = None |
453 self._node = None | 455 self._node = None |
454 if parents: | 456 if parents: |
455 p1, p2 = parents | 457 p1, p2 = parents |
456 self._parents = [self._repo.changectx(p) for p in (p1, p2)] | 458 self._parents = [self._repo.changectx(p) for p in (p1, p2)] |
459 if changes: | |
460 self._status = list(changes) | |
457 | 461 |
458 def __str__(self): | 462 def __str__(self): |
459 return str(self._parents[0]) + "+" | 463 return str(self._parents[0]) + "+" |
460 | 464 |
461 def __nonzero__(self): | 465 def __nonzero__(self): |