Skip to content
Snippets Groups Projects
Commit 8ff4532376a4 authored by mpm's avatar mpm
Browse files

hg checkout: refuse to checkout if there are outstanding changes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hg checkout: refuse to checkout if there are outstanding changes

This is a stop-gap until I make the working dir logic smarter

manifest hash: a3f6adcb7eecec294000039057d59771958f4186
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCnnrKywK+sNU5EO8RAtqBAJwPQQrW5GhjMP9HMkFtfD7qhqxIcgCfXvA4
oXHO13uzBn5JOaTH3KwsMbQ=
=IzTY
-----END PGP SIGNATURE-----
parent 06bc1ef248a6
No related branches found
No related tags found
No related merge requests found
......@@ -129,12 +129,6 @@
if os.getcwd() != repo.root:
relpath = os.getcwd()[len(repo.root) + 1: ]
if cmd == "checkout" or cmd == "co":
node = repo.changelog.tip()
if args:
node = repo.lookup(args[0])
repo.checkout(node)
elif cmd == "add":
repo.add(args)
......
......@@ -68,5 +68,5 @@
# this should eventually support remote repos
os.system("cp -al %s/.hg .hg" % path)
def checkout(u, repo, changeset=None):
def checkout(ui, repo, changeset=None):
'''checkout a given changeset or the current tip'''
......@@ -72,4 +72,9 @@
'''checkout a given changeset or the current tip'''
(c, a, d) = repo.diffdir(repo.root, repo.current)
if c:
ui.warn("aborting (outstanding changes in working directory)\n")
sys.exit(1)
node = repo.changelog.tip()
if changeset:
node = repo.lookup(changeset)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment