mercurial/commands.py
changeset 220 3113a94c1bff
parent 219 8ff4532376a4
child 221 2bfe525ef6ca
equal deleted inserted replaced
219:8ff4532376a4 220:3113a94c1bff
    68     # this should eventually support remote repos
    68     # this should eventually support remote repos
    69     os.system("cp -al %s/.hg .hg" % path)
    69     os.system("cp -al %s/.hg .hg" % path)
    70 
    70 
    71 def checkout(ui, repo, changeset=None):
    71 def checkout(ui, repo, changeset=None):
    72     '''checkout a given changeset or the current tip'''
    72     '''checkout a given changeset or the current tip'''
    73     (c, a, d) = repo.diffdir(repo.root, repo.current)
    73     (c, a, d, u) = repo.diffdir(repo.root, repo.current)
    74     if c:
    74     if c or a or d:
    75         ui.warn("aborting (outstanding changes in working directory)\n")
    75         ui.warn("aborting (outstanding changes in working directory)\n")
    76         sys.exit(1)
    76         sys.exit(1)
    77 
    77 
    78     node = repo.changelog.tip()
    78     node = repo.changelog.tip()
    79     if changeset:
    79     if changeset:
   127 
   127 
   128 C = changed
   128 C = changed
   129 A = added
   129 A = added
   130 R = removed
   130 R = removed
   131 ? = not tracked'''
   131 ? = not tracked'''
   132     (c, a, d) = repo.diffdir(repo.root, repo.current)
   132     (c, a, d, u) = repo.diffdir(repo.root, repo.current)
   133     (c, a, d) = map(lambda x: relfilter(repo, x), (c, a, d))
   133     (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u))
   134 
   134 
   135     for f in c: print "C", f
   135     for f in c: print "C", f
   136     for f in a: print "?", f
   136     for f in a: print "A", f
   137     for f in d: print "R", f
   137     for f in d: print "R", f
       
   138     for f in u: print "?", f
   138 
   139 
   139 def undo(ui, repo):
   140 def undo(ui, repo):
   140     repo.undo()
   141     repo.undo()
   141 
   142 
   142 table = {
   143 table = {