Show More
@@ -446,14 +446,26 class workingctx(changectx): | |||
|
446 | 446 | """A workingctx object makes access to data related to |
|
447 | 447 | the current working directory convenient. |
|
448 | 448 | parents - a pair of parent nodeids, or None to use the dirstate. |
|
449 | date - any valid date string or (unixtime, offset), or None. | |
|
450 | user - username string, or None. | |
|
449 | 451 | extra - a dictionary of extra values, or None. |
|
450 | 452 | changes - a list of file lists as returned by localrepo.status() |
|
451 | 453 | or None to use the repository status. |
|
452 | 454 | """ |
|
453 |
def __init__(self, repo, parents=None, extr |
|
|
455 | def __init__(self, repo, parents=None, text="", user=None, date=None, | |
|
456 | extra=None, changes=None): | |
|
454 | 457 | self._repo = repo |
|
455 | 458 | self._rev = None |
|
456 | 459 | self._node = None |
|
460 | self._text = text | |
|
461 | if date is not None: | |
|
462 | self._date = util.parsedate(date) | |
|
463 | else: | |
|
464 | self._date = util.makedate() | |
|
465 | if user: | |
|
466 | self._user = user | |
|
467 | else: | |
|
468 | self._user = self._repo.ui.username() | |
|
457 | 469 | if parents: |
|
458 | 470 | p1, p2 = parents |
|
459 | 471 | self._parents = [self._repo.changectx(p) for p in (p1, p2)] |
@@ -518,9 +530,9 class workingctx(changectx): | |||
|
518 | 530 | |
|
519 | 531 | def manifest(self): return self._manifest |
|
520 | 532 | |
|
521 |
def user(self): return self._ |
|
|
522 |
def date(self): return |
|
|
523 |
def description(self): return |
|
|
533 | def user(self): return self._user | |
|
534 | def date(self): return self._date | |
|
535 | def description(self): return self._text | |
|
524 | 536 | def files(self): |
|
525 | 537 | f = self.modified() + self.added() + self.removed() |
|
526 | 538 | f.sort() |
@@ -491,8 +491,10 class localrepository(repo.repository): | |||
|
491 | 491 | def changectx(self, changeid=None): |
|
492 | 492 | return context.changectx(self, changeid) |
|
493 | 493 | |
|
494 |
def workingctx(self, parents=None, extr |
|
|
495 | return context.workingctx(self, parents, extra, changes) | |
|
494 | def workingctx(self, parents=None, text="", user=None, date=None, | |
|
495 | extra=None, changes=None): | |
|
496 | return context.workingctx(self, parents, text, user, date, extra, | |
|
497 | changes) | |
|
496 | 498 | |
|
497 | 499 | def parents(self, changeid=None): |
|
498 | 500 | ''' |
@@ -795,11 +797,13 class localrepository(repo.repository): | |||
|
795 | 797 | update_dirstate = (self.dirstate.parents()[0] == p1) |
|
796 | 798 | changes = [files, [], [], [], []] |
|
797 | 799 | |
|
798 | wctx = self.workingctx((p1, p2), extra, changes) | |
|
800 | wctx = self.workingctx((p1, p2), text, user, date, extra, changes) | |
|
799 | 801 | commit = wctx.modified() + wctx.added() |
|
800 | 802 | remove = wctx.removed() |
|
801 | 803 | extra = wctx.extra().copy() |
|
802 | 804 | branchname = extra['branch'] |
|
805 | user = wctx.user() | |
|
806 | text = wctx.description() | |
|
803 | 807 | |
|
804 | 808 | c1 = self.changelog.read(p1) |
|
805 | 809 | c2 = self.changelog.read(p2) |
@@ -868,7 +872,6 class localrepository(repo.repository): | |||
|
868 | 872 | (new, removed)) |
|
869 | 873 | |
|
870 | 874 | # add changeset |
|
871 | user = user or self.ui.username() | |
|
872 | 875 | if (not empty_ok and not text) or force_editor: |
|
873 | 876 | edittext = [] |
|
874 | 877 | if text: |
@@ -901,7 +904,7 class localrepository(repo.repository): | |||
|
901 | 904 | text = '\n'.join(lines) |
|
902 | 905 | |
|
903 | 906 | n = self.changelog.add(mn, changed + removed, text, trp, p1, p2, |
|
904 | user, date, extra) | |
|
907 | user, wctx.date(), extra) | |
|
905 | 908 | self.hook('pretxncommit', throw=True, node=hex(n), parent1=xp1, |
|
906 | 909 | parent2=xp2) |
|
907 | 910 | tr.close() |
General Comments 0
You need to be logged in to leave comments.
Login now