Method: RIM::StatusBuilder#rev_history_status
- Defined in:
- lib/rim/status_builder.rb
#rev_history_status(git_session, rev, options = {}) ⇒ Object
status object tree for revision rev returns the root status object which points to any parent status objects note that merge commits mean that the status tree branches at the point were the merged branch branched off, the status tree joins i.e. the parent status objects are the same at this point
stops traversing a specific branch when a commit is found which is an ancestor of :stop_rev or any remote branch if :stop_rev is not provided;
with the :gerrit option, stops traversing on any ancestor of any known commit; this is necessary since on gerrit there are no “remote” commits; at the same time, gerrit doesn’t “know” commits pushed in the ref-update hook yet so the status will be built for the new commits pushed in the ref-update hook
the leafs of the tree are the stop commits or commits which have no parents
with the :fast option set to true, the leafs in the tree will not be checked but instead all modules present in those commits will assumed to be clean; be aware that this assumption might be wrong! if the leaves of the tree are remote commits, the fast check basically tells if any of the local commits is dirty or not
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/rim/status_builder.rb', line 31 def rev_history_status(git_session, rev, ={}) stop_rev = [:stop_rev] relevant_revs = {} if stop_rev git_session.execute("git rev-list #{rev} \"^#{stop_rev}\"").split("\n").each do |r| relevant_revs[r] = true end elsif [:gerrit] # in gerrit mode, stop on all known commits git_session.execute("git rev-list #{rev} --not --all --").split("\n").each do |r| relevant_revs[r] = true end else # remote revs are where we stop traversal git_session.all_reachable_non_remote_revs(rev).each do |r| relevant_revs[r] = true end end # make sure we deal only with sha1s rev = git_session.rev_sha1(rev) build_rev_history_status(git_session, rev, relevant_revs, {}, :fast => [:fast]) end |