Show More
@@ -129,12 +129,6 b' relpath = None' | |||||
129 | if os.getcwd() != repo.root: |
|
129 | if os.getcwd() != repo.root: | |
130 | relpath = os.getcwd()[len(repo.root) + 1: ] |
|
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 | elif cmd == "add": |
|
132 | elif cmd == "add": | |
139 | repo.add(args) |
|
133 | repo.add(args) | |
140 |
|
134 |
@@ -68,8 +68,13 b' def branch(ui, path):' | |||||
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(u, 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) | |||
|
74 | if c: | |||
|
75 | ui.warn("aborting (outstanding changes in working directory)\n") | |||
|
76 | sys.exit(1) | |||
|
77 | ||||
73 | node = repo.changelog.tip() |
|
78 | node = repo.changelog.tip() | |
74 | if changeset: |
|
79 | if changeset: | |
75 | node = repo.lookup(changeset) |
|
80 | node = repo.lookup(changeset) |
General Comments 0
You need to be logged in to leave comments.
Login now