lib/git_topic.rb
# Done with the given topic.  If none is specified, then topic is assumed to
# be the current branch (if it's a topic branch).
Done with the given topic.  If none is specified, then topic is assumed to
be the current branch (if it's a topic branch).
Done with the given topic . If none is specified then topic is assumed to be the current branch ( if it ' s a topic branch ) .
def done  topic=nil, opts={}
      if topic.nil?
        raise "
          Current branch is not a topic branch.  Switch to a topic branch or
          supply an argument.
        ".oneline if current_topic.nil?
        topic = current_topic
      else
        raise "
          Specified topic #{topic} does not refer to a topic branch.
        " unless branches.include? wip_branch( topic )
      end
      raise "Working tree must be clean" unless working_tree_clean?
      wb = wip_branch( topic )
      rb = review_branch( topic )
      refspecs = [
        "refs/heads/#{wb}:refs/heads/#{rb}",
        ":refs/heads/#{wb}",
        "refs/notes/reviews/*:refs/notes/reviews/*"
      ].join( " " )
      git [
        "push origin #{refspecs}",
        ("checkout master" if strip_namespace( topic ) == current_topic),
        "branch -D #{wip_branch( topic )}"
      ].compact
      report "Completed topic #{topic}.  It has been pushed for review."
    end
def done topic = nil , opts = { } if topic . nil? raise "
          Current branch is not a topic branch.  Switch to a topic branch or
          supply an argument.
        " . oneline if current_topic . nil? topic = current_topic else raise "
          Specified topic #{topic} does not refer to a topic branch.
        " unless branches . include? wip_branch ( topic ) end raise "Working tree must be clean" unless working_tree_clean? wb = wip_branch ( topic ) rb = review_branch ( topic ) refspecs = [ "refs/heads/#{wb}:refs/heads/#{rb}" , ":refs/heads/#{wb}" , "refs/notes/reviews/*:refs/notes/reviews/*" ] . join ( " " ) git [ "push origin #{refspecs}" , ( "checkout master" if strip_namespace ( topic ) == current_topic ) , "branch -D #{wip_branch( topic )}" ] . compact report "Completed topic #{topic}.  It has been pushed for review." end
Done with the given topic.
Done with the given topic .
topic
opts