class BetweenMeals::Repo::Hg::Cmd

Public Instance Methods

amend(msg) click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 48
def amend(msg)
  f = Tempfile.new('between_meals.hg.amend')
  begin
    f.write(msg)
    f.flush
    cmd("commit --amend --exclude '**' -l #{f.path}")
  ensure
    f.close
    f.unlink
  end
end
clone(url, repo_path) click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 32
def clone(url, repo_path)
  cmd("clone #{url} #{repo_path}")
end
log(template, rev = '.') click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 28
def log(template, rev = '.')
  cmd("log -r #{rev} -l 1 -T '{#{template}}'")
end
manifest() click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 40
def manifest
  cmd('manifest')
end
pull() click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 36
def pull
  cmd('pull --rebase')
end
rev(rev) click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 24
def rev(rev)
  cmd("log -r #{rev}")
end
status(start_ref = nil, end_ref = nil) click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 60
def status(start_ref = nil, end_ref = nil)
  if start_ref && end_ref
    cmd("status --rev #{start_ref} --rev #{end_ref}")
  elsif start_ref
    cmd("status --rev #{start_ref}")
  else
    cmd('status')
  end
end
username() click to toggle source
# File lib/between_meals/repo/hg/cmd.rb, line 44
def username
  cmd('config ui.username')
end