##// END OF EJS Templates
dirstate: rename forget to drop...
Matt Mackall -
r14434:cc8c0985 default
parent child Browse files
Show More
@@ -1302,7 +1302,7 b' class queue(object):'
1302 except OSError, e:
1302 except OSError, e:
1303 if e.errno != errno.ENOENT:
1303 if e.errno != errno.ENOENT:
1304 raise
1304 raise
1305 repo.dirstate.forget(f)
1305 repo.dirstate.drop(f)
1306 for f in m + r:
1306 for f in m + r:
1307 fctx = ctx[f]
1307 fctx = ctx[f]
1308 repo.wwrite(f, fctx.data(), fctx.flags())
1308 repo.wwrite(f, fctx.data(), fctx.flags())
@@ -1480,7 +1480,7 b' class queue(object):'
1480 for f in mm:
1480 for f in mm:
1481 repo.dirstate.normallookup(f)
1481 repo.dirstate.normallookup(f)
1482 for f in forget:
1482 for f in forget:
1483 repo.dirstate.forget(f)
1483 repo.dirstate.drop(f)
1484
1484
1485 if not msg:
1485 if not msg:
1486 if not ph.message:
1486 if not ph.message:
@@ -2617,7 +2617,7 b' def rename(ui, repo, patch, name=None, *'
2617 wlock = r.wlock()
2617 wlock = r.wlock()
2618 try:
2618 try:
2619 if r.dirstate[patch] == 'a':
2619 if r.dirstate[patch] == 'a':
2620 r.dirstate.forget(patch)
2620 r.dirstate.drop(patch)
2621 r.dirstate.add(name)
2621 r.dirstate.add(name)
2622 else:
2622 else:
2623 if r.dirstate[name] == 'r':
2623 if r.dirstate[name] == 'r':
@@ -4264,7 +4264,7 b' def revert(ui, repo, *pats, **opts):'
4264 audit_path = scmutil.pathauditor(repo.root)
4264 audit_path = scmutil.pathauditor(repo.root)
4265 for f in remove[0]:
4265 for f in remove[0]:
4266 if repo.dirstate[f] == 'a':
4266 if repo.dirstate[f] == 'a':
4267 repo.dirstate.forget(f)
4267 repo.dirstate.drop(f)
4268 continue
4268 continue
4269 audit_path(f)
4269 audit_path(f)
4270 try:
4270 try:
@@ -842,7 +842,7 b' class workingctx(changectx):'
842 if self._repo.dirstate[f] != 'a':
842 if self._repo.dirstate[f] != 'a':
843 self._repo.ui.warn(_("%s not added!\n") % f)
843 self._repo.ui.warn(_("%s not added!\n") % f)
844 else:
844 else:
845 self._repo.dirstate.forget(f)
845 self._repo.dirstate.drop(f)
846 finally:
846 finally:
847 wlock.release()
847 wlock.release()
848
848
@@ -863,7 +863,7 b' class workingctx(changectx):'
863 raise
863 raise
864 for f in list:
864 for f in list:
865 if self._repo.dirstate[f] == 'a':
865 if self._repo.dirstate[f] == 'a':
866 self._repo.dirstate.forget(f)
866 self._repo.dirstate.drop(f)
867 elif f not in self._repo.dirstate:
867 elif f not in self._repo.dirstate:
868 self._repo.ui.warn(_("%s not tracked!\n") % f)
868 self._repo.ui.warn(_("%s not tracked!\n") % f)
869 else:
869 else:
@@ -365,14 +365,11 b' class dirstate(object):'
365 if f in self._copymap:
365 if f in self._copymap:
366 del self._copymap[f]
366 del self._copymap[f]
367
367
368 def forget(self, f):
368 def drop(self, f):
369 '''Forget a file.'''
369 '''Drop a file from the dirstate'''
370 self._dirty = True
370 self._dirty = True
371 try:
371 self._droppath(f)
372 self._droppath(f)
372 del self._map[f]
373 del self._map[f]
374 except KeyError:
375 self._ui.warn(_("not in dirstate: %s\n") % f)
376
373
377 def _normalize(self, path, isknown):
374 def _normalize(self, path, isknown):
378 normed = os.path.normcase(path)
375 normed = os.path.normcase(path)
@@ -1037,7 +1037,7 b' class localrepository(repo.repository):'
1037 for f in changes[0] + changes[1]:
1037 for f in changes[0] + changes[1]:
1038 self.dirstate.normal(f)
1038 self.dirstate.normal(f)
1039 for f in changes[2]:
1039 for f in changes[2]:
1040 self.dirstate.forget(f)
1040 self.dirstate.drop(f)
1041 self.dirstate.setparents(ret)
1041 self.dirstate.setparents(ret)
1042 ms.reset()
1042 ms.reset()
1043 finally:
1043 finally:
@@ -390,12 +390,12 b' def recordupdates(repo, action, branchme'
390 if branchmerge:
390 if branchmerge:
391 repo.dirstate.remove(f)
391 repo.dirstate.remove(f)
392 else:
392 else:
393 repo.dirstate.forget(f)
393 repo.dirstate.drop(f)
394 elif m == "a": # re-add
394 elif m == "a": # re-add
395 if not branchmerge:
395 if not branchmerge:
396 repo.dirstate.add(f)
396 repo.dirstate.add(f)
397 elif m == "f": # forget
397 elif m == "f": # forget
398 repo.dirstate.forget(f)
398 repo.dirstate.drop(f)
399 elif m == "e": # exec change
399 elif m == "e": # exec change
400 repo.dirstate.normallookup(f)
400 repo.dirstate.normallookup(f)
401 elif m == "g": # get
401 elif m == "g": # get
@@ -425,7 +425,7 b' def recordupdates(repo, action, branchme'
425 if f2 == fd: # file not locally copied/moved
425 if f2 == fd: # file not locally copied/moved
426 repo.dirstate.normallookup(fd)
426 repo.dirstate.normallookup(fd)
427 if move:
427 if move:
428 repo.dirstate.forget(f)
428 repo.dirstate.drop(f)
429 elif m == "d": # directory rename
429 elif m == "d": # directory rename
430 f2, fd, flag = a[2:]
430 f2, fd, flag = a[2:]
431 if not f2 and f not in repo.dirstate:
431 if not f2 and f not in repo.dirstate:
@@ -441,7 +441,7 b' def recordupdates(repo, action, branchme'
441 else:
441 else:
442 repo.dirstate.normal(fd)
442 repo.dirstate.normal(fd)
443 if f:
443 if f:
444 repo.dirstate.forget(f)
444 repo.dirstate.drop(f)
445
445
446 def update(repo, node, branchmerge, force, partial, ancestor=None):
446 def update(repo, node, branchmerge, force, partial, ancestor=None):
447 """
447 """
General Comments 0
You need to be logged in to leave comments. Login now