def __init__(self, repos, sha): try: msg, props = repos.git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert 'children' not in props _children = list(repos.git.children(sha)) if _children: props['children'] = _children # use 1st author/committer as changeset owner/timestamp if repos._use_committer_time: _, time_ = _parse_user_time(props['committer'][0]) else: _, time_ = _parse_user_time(props['author'][0]) if repos._use_committer_id: user_, _ = _parse_user_time(props['committer'][0]) else: user_, _ = _parse_user_time(props['author'][0]) # try to resolve email address to trac uid user_ = repos.rlookup_uid(user_) or user_ Changeset.__init__(self, repos, rev=sha, message=msg, author=user_, date=time_)
def __init__(self, git, sha): self.git = git try: (msg, props) = git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert 'children' not in props _children = list(git.children(sha)) if _children: props['children'] = _children # use 1st committer as changeset owner/timestamp (user_, time_) = _parse_user_time(props['committer'][0]) Changeset.__init__(self, sha, msg, user_, time_)
def __init__(self, repos, sha): self.repos = repos try: (msg, props) = repos.git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert "children" not in props _children = list(repos.git.children(sha)) if _children: props["children"] = _children # use 1st committer as changeset owner/timestamp (user_, time_) = _parse_user_time(props["committer"][0]) Changeset.__init__(self, repos, sha, msg, user_, time_)
def __init__(self, repos, sha): if sha is None: raise NoSuchChangeset(sha) try: msg, props = repos.git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert 'children' not in props _children = list(repos.git.children(sha)) if _children: props['children'] = _children committer, author = self._get_committer_and_author() # use 1st author/committer as changeset owner/timestamp c_user = a_user = c_time = a_time = None if committer: c_user, c_time = _parse_user_time(committer) if author: a_user, a_time = _parse_user_time(author) if repos.use_committer_time: time = c_time or a_time else: time = a_time or c_time if repos.use_committer_id: user = c_user or a_user else: user = a_user or c_user # try to resolve email address to trac uid user = repos.rlookup_uid(user) or user Changeset.__init__(self, repos, rev=sha, message=msg, author=user, date=time)
def __init__(self, repos, n): log = repos.repo.changelog log_data = log.read(n) manifest, user, timeinfo, files, desc = log_data[:5] extra = {} if len(log_data) > 5: # extended changelog, since [hg 2f35961854fb] extra = log_data[5] time = repos.hg_time(timeinfo) Changeset.__init__(self, repos, repos.hg_display(n), to_unicode(desc), to_unicode(user), time) self.repos = repos self.n = n self.manifest_n = manifest self.files = files self.parents = [repos.hg_display(p) for p in log.parents(n) \ if p != nullid] self.children = [repos.hg_display(c) for c in log.children(n)] self.tags = [t for t in repos.repo.nodetags(n)] self.branch = extra.pop("branch", None) self.extra = extra
def __init__(self, repos, sha): if sha is None: raise NoSuchChangeset(sha) try: msg, props = repos.git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert 'children' not in props _children = list(repos.git.children(sha)) if _children: props['children'] = _children committer, author = self._get_committer_and_author() # use 1st author/committer as changeset owner/timestamp c_user = a_user = c_time = a_time = None if committer: c_user, c_time = _parse_user_time(committer) if author: a_user, a_time = _parse_user_time(author) if repos.use_committer_time: time = c_time or a_time else: time = a_time or c_time if repos.use_committer_id: user = c_user or a_user else: user = a_user or c_user # try to resolve email address to trac uid user = repos.rlookup_uid(user) or user Changeset.__init__(self, repos, rev=sha, message=msg, author=user, date=time)
def __init__(self, repos, sha): if sha is None: raise NoSuchChangeset(sha) try: msg, props = repos.git.read_commit(sha) except PyGIT.GitErrorSha: raise NoSuchChangeset(sha) self.props = props assert 'children' not in props _children = list(repos.git.children(sha)) if _children: props['children'] = _children # use 1st author/committer as changeset owner/timestamp if repos._use_committer_time: _, time_ = _parse_user_time(props['committer'][0]) else: _, time_ = _parse_user_time(props['author'][0]) if repos._use_committer_id: user_, _ = _parse_user_time(props['committer'][0]) else: user_, _ = _parse_user_time(props['author'][0]) # try to resolve email address to trac uid user_ = repos.rlookup_uid(user_) or user_ Changeset.__init__(self, repos, rev=sha, message=msg, author=user_, date=time_)
def __init__(self, repos, rev, desc, user, time, log): self.repos = repos self.rev = rev self.log = log Changeset.__init__(self, repos, rev, desc, user, datetime.datetime.fromtimestamp(time,utc))
def __init__(self, repos, rev, desc, user, time, log): self.repos = repos self.rev = rev self.log = log Changeset.__init__(self, repos, rev, desc, user, datetime.datetime.fromtimestamp(time, utc))