##// END OF EJS Templates
hg checkout: refuse to checkout if there are outstanding changes...
mpm@selenic.com -
r219:8ff45323 default
parent child Browse files
Show More
@@ -129,12 +129,6 b' relpath = None'
129 129 if os.getcwd() != repo.root:
130 130 relpath = os.getcwd()[len(repo.root) + 1: ]
131 131
132 if cmd == "checkout" or cmd == "co":
133 node = repo.changelog.tip()
134 if args:
135 node = repo.lookup(args[0])
136 repo.checkout(node)
137
138 132 elif cmd == "add":
139 133 repo.add(args)
140 134
@@ -68,8 +68,13 b' def branch(ui, path):'
68 68 # this should eventually support remote repos
69 69 os.system("cp -al %s/.hg .hg" % path)
70 70
71 def checkout(u, repo, changeset=None):
71 def checkout(ui, repo, changeset=None):
72 72 '''checkout a given changeset or the current tip'''
73 (c, a, d) = repo.diffdir(repo.root, repo.current)
74 if c:
75 ui.warn("aborting (outstanding changes in working directory)\n")
76 sys.exit(1)
77
73 78 node = repo.changelog.tip()
74 79 if changeset:
75 80 node = repo.lookup(changeset)
General Comments 0
You need to be logged in to leave comments. Login now