[PATCH 1 of 2] Fix addremove for symlinks to non-existent files
Giorgos Keramidas
keramida at ceid.upatras.gr
Fri Feb 23 15:55:37 UTC 2007
# HG changeset patch
# User Giorgos Keramidas <keramida at ceid.upatras.gr>
# Date 1168025329 -7200
# Node ID 8450de1af661b51bf9c732276a180cc01f47bfdc
# Parent 226df1808f16312ffc2acc4a41a6fd5de2d5de71
Fix addremove for symlinks to non-existent files
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -176,7 +176,8 @@ def addremove(repo, pats=[], opts={}, wl
mapping[abs] = rel, exact
if repo.ui.verbose or not exact:
repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
- if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
+ islink = os.path.islink(rel)
+ if repo.dirstate.state(abs) != 'r' and not islink and not os.path.exists(rel):
remove.append(abs)
mapping[abs] = rel, exact
if repo.ui.verbose or not exact:
More information about the Mercurial-devel
mailing list