diff tests/test-log @ 11899:99cafcae25d9

log: do not --follow file that is deleted and recreated later (issue732) == What == issue732 is only one example of a buggy behaviour, but there are in fact many intricated cases. For example: ( "o" contains an alive version of the tracked file, "x" does not) tip - o - o - x - o - o - x ... \ o - o - o - o - x ... \ / o - o This repository contains at least two instances of the tracked file, but when calling "hg log -f file" only the latest one (the one alive in tip) matters to us. == How == We must extract from the filelog the history of the file instance we're interested in and discard changes related to other instances of that file. We see that we're only interested in ancestors(node), and that all other nodes in the filelog should not be considered.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun, 15 Aug 2010 23:17:53 +0900
parents dbb98d8fbcaf
children
line wrap: on
line diff
--- a/tests/test-log	Sun Aug 15 22:44:15 2010 +0900
+++ b/tests/test-log	Sun Aug 15 23:17:53 2010 +0900
@@ -200,4 +200,53 @@
 hg log -p -R .. ../a
 
 
+cd ..
+hg init follow2
+cd follow2
+
+# Build the following history:
+# tip - o - x - o - x - x
+#    \                 /
+#     o - o - o - x
+#      \     /
+#         o
+#
+# Where "o" is a revision containing "foo" and
+# "x" is a revision without "foo"
+touch init
+hg ci -A -m "init, unrelated"
+echo 'foo' > init
+hg ci -m "change, unrelated"
+echo 'foo' > foo
+hg ci -A -m "add unrelated old foo"
+hg rm foo
+hg ci -m "delete foo, unrelated"
+echo 'related' > foo
+hg ci -A -m "add foo, related"
+
+hg up 0
+touch branch
+hg ci -A -m "first branch, unrelated"
+touch foo
+hg ci -A -m "create foo, related"
+echo 'change' > foo
+hg ci -m "change foo, related"
+
+hg up 6
+echo 'change foo in branch' > foo
+hg ci -m "change foo in branch, related"
+hg merge 7
+echo 'merge 1' > foo
+hg resolve -m foo
+hg ci -m "First merge, related"
+
+hg merge 4
+echo 'merge 2' > foo
+hg resolve -m foo
+hg ci -m "Last merge, related"
+
+hg --config "extensions.graphlog=" glog
+
+hg --traceback log -f foo
+
 exit 0