Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 219:8ff4532376a4
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-----
author | mpm@selenic.com |
---|---|
date | Wed, 01 Jun 2005 19:19:38 -0800 |
parents | 2d60aa9bde0a |
children | 3113a94c1bff |
comparison
equal
deleted
inserted
replaced
218:06bc1ef248a6 | 219:8ff4532376a4 |
---|---|
66 def branch(ui, path): | 66 def branch(ui, path): |
67 '''branch from a local repository''' | 67 '''branch from a local repository''' |
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) |
76 repo.checkout(node) | 81 repo.checkout(node) |
77 | 82 |