# HG changeset patch # User Patrick Mezard # Date 1216573740 -7200 # Node ID 89ec85aa6cc3285652177c58d4d966c4bec51e32 # Parent 6a9025a667aea1b9a7bb30bb653e771c2604e1e3 context: trigger missing username warning only when necessary diff -r 6a9025a667ae -r 89ec85aa6cc3 mercurial/context.py --- a/mercurial/context.py Fri Jul 18 12:31:40 2008 +0200 +++ b/mercurial/context.py Sun Jul 20 19:09:00 2008 +0200 @@ -472,10 +472,7 @@ self._date = util.parsedate(date) else: self._date = util.makedate() - if user: - self._user = user - else: - self._user = self._repo.ui.username() + self._user = user if parents: self._parents = [changectx(self._repo, p) for p in parents] if changes: @@ -543,7 +540,7 @@ def manifest(self): return self._manifest - def user(self): return self._user + def user(self): return self._user or self._repo.ui.username() def date(self): return self._date def description(self): return self._text def files(self): @@ -703,7 +700,7 @@ self._node = None self._text = text self._date = date and util.parsedate(date) or util.makedate() - self._user = user or self._repo.ui.username() + self._user = user parents = [(p or nullid) for p in parents] p1, p2 = parents self._parents = [changectx(self._repo, p) for p in (p1, p2)] @@ -726,7 +723,7 @@ def __nonzero__(self): return True - def user(self): return self._user + def user(self): return self._user or self._repo.ui.username() def date(self): return self._date def description(self): return self._text def files(self): return self.modified()