Mercurial > hg
comparison mercurial/hg.py @ 402:2fe8d66e3075
[PATCH] (3/4) Removing an added file
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] (3/4) Removing an added file
From: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
Here's an hg changeset that deals with "hg add"ing and then "hg remove"ing
a file without ever committing it. Previously, this caused a python
exception
at commit time.
Test case included in the patch.
manifest hash: 4d012f3f8b1aa664fed9e8bc2849931b28728acd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCuMPtywK+sNU5EO8RAuxMAKCmeMLqOUBmUfCfbQgYOAysOvKkwgCfcJai
2My0M7KqhwnJSbZXbGIOcow=
=N7N0
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Tue, 21 Jun 2005 17:50:37 -0800 |
parents | e9e1efd5291c |
children | 99470ae6b424 |
comparison
equal
deleted
inserted
replaced
401:af4848f83e68 | 402:2fe8d66e3075 |
---|---|
704 def remove(self, list): | 704 def remove(self, list): |
705 for f in list: | 705 for f in list: |
706 p = self.wjoin(f) | 706 p = self.wjoin(f) |
707 if os.path.isfile(p): | 707 if os.path.isfile(p): |
708 self.ui.warn("%s still exists!\n" % f) | 708 self.ui.warn("%s still exists!\n" % f) |
709 elif self.dirstate.state(f) == 'a': | |
710 self.ui.warn("%s never committed!\n" % f) | |
711 self.dirstate.forget(f) | |
709 elif f not in self.dirstate: | 712 elif f not in self.dirstate: |
710 self.ui.warn("%s not tracked!\n" % f) | 713 self.ui.warn("%s not tracked!\n" % f) |
711 else: | 714 else: |
712 self.dirstate.update([f], "r") | 715 self.dirstate.update([f], "r") |
713 | 716 |