comparison mercurial/merge.py @ 14434:cc8c09855d19

dirstate: rename forget to drop It has substantially different semantics from forget at the command layer, so change it to avoid confusion. We can't simply combine it with remove because we need to explicitly drop non-added files in some cases like commit.
author Matt Mackall <mpm@selenic.com>
date Thu, 26 May 2011 17:15:35 -0500
parents c97c10a1b4bc
children 610873cf064a
comparison
equal deleted inserted replaced
14433:7658221da551 14434:cc8c09855d19
388 f, m = a[:2] 388 f, m = a[:2]
389 if m == "r": # remove 389 if m == "r": # remove
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
402 if branchmerge: 402 if branchmerge:
403 repo.dirstate.otherparent(f) 403 repo.dirstate.otherparent(f)
423 # merge will appear as a normal local file 423 # merge will appear as a normal local file
424 # modification. 424 # modification.
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:
432 # untracked file moved 432 # untracked file moved
433 continue 433 continue
439 if f2: 439 if f2:
440 repo.dirstate.copy(f2, fd) 440 repo.dirstate.copy(f2, fd)
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 """
448 Perform a merge between the working directory and the given node 448 Perform a merge between the working directory and the given node
449 449