comparison mercurial/hg.py @ 781:26f3d353851f

Fix copy in subdirectories Spotted by Chad Netzer
author mpm@selenic.com
date Wed, 27 Jul 2005 10:05:12 -0800
parents 5cb8a3a023b2
children 46a8dd3145cc
comparison
equal deleted inserted replaced
780:5cb8a3a023b2 781:26f3d353851f
957 else: 957 else:
958 self.dirstate.update([f], "r") 958 self.dirstate.update([f], "r")
959 959
960 def copy(self, source, dest): 960 def copy(self, source, dest):
961 p = self.wjoin(dest) 961 p = self.wjoin(dest)
962 if not os.path.exists(dest): 962 if not os.path.exists(p):
963 self.ui.warn("%s does not exist!\n" % dest) 963 self.ui.warn("%s does not exist!\n" % dest)
964 elif not os.path.isfile(dest): 964 elif not os.path.isfile(p):
965 self.ui.warn("copy failed: %s is not a file\n" % dest) 965 self.ui.warn("copy failed: %s is not a file\n" % dest)
966 else: 966 else:
967 if self.dirstate.state(dest) == '?': 967 if self.dirstate.state(dest) == '?':
968 self.dirstate.update([dest], "a") 968 self.dirstate.update([dest], "a")
969 self.dirstate.copy(source, dest) 969 self.dirstate.copy(source, dest)