[PATCH] rm -A removes a modified file from the repo, but keeps it in the working dir
mathieu.clabaut at gmail.com
mathieu.clabaut at gmail.com
Tue Nov 13 22:12:35 UTC 2007
# HG changeset patch
# User Mathieu Clabaut <mathieu.clabaut at gmail.com>
# Date 1194990674 -3600
# Node ID 24f0169c3b6a795a3f2a74f2b07c821c98a2997f
# Parent 6cf7d7fe7d3d01e2bd42d253543fc3e07fd2c66f
rm -A removes a modified file from the repo, but keeps it in the working dir
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2236,7 +2236,7 @@ def remove(ui, repo, *pats, **opts):
ui.status(_('removing %s\n') % rel)
remove.append(abs)
repo.forget(forget)
- repo.remove(remove, unlink=opts['force'] or not opts['after'])
+ repo.remove(remove, unlink=not opts['after'])
def rename(ui, repo, *pats, **opts):
"""rename files; equivalent of copy + remove
diff --git a/tests/test-remove-after b/tests/test-remove-after
new file mode 100755
--- /dev/null
+++ b/tests/test-remove-after
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+echo % init
+hg init
+
+echo % commit
+echo 'a' > a
+hg ci -A -m test -u nobody -d '1 0'
+
+echo % altering
+echo 'foo' >> a
+
+echo % removing
+hg rm -A -f a
+
+echo % presence
+test -f a && echo OK a still exists || echo NOK a was removed
diff --git a/tests/test-remove-after.out b/tests/test-remove-after.out
new file mode 100644
--- /dev/null
+++ b/tests/test-remove-after.out
@@ -0,0 +1,7 @@
+% init
+% commit
+adding a
+% altering
+% removing
+% presence
+OK a still exists
More information about the Mercurial-devel
mailing list