##// END OF EJS Templates
fix: add test case that shows why --whole with --base is useful...
Danny Hooper -
r38609:f068495a @71 default
parent child Browse files
Show More
@@ -385,7 +385,9 b' def getbasectxs(repo, opts, revstofix):'
385 385 """Returns a map of the base contexts for each revision
386 386
387 387 The base contexts determine which lines are considered modified when we
388 attempt to fix just the modified lines in a file.
388 attempt to fix just the modified lines in a file. It also determines which
389 files we attempt to fix, so it is important to compute this even when
390 --whole is used.
389 391 """
390 392 # The --base flag overrides the usual logic, and we give every revision
391 393 # exactly the set of baserevs that the user specified.
@@ -1027,3 +1027,29 b' an orphan. We must respect experimental.'
1027 1027
1028 1028 $ cd ..
1029 1029
1030 The --base flag affects the set of files being fixed. So while the --whole flag
1031 makes the base irrelevant for changed line ranges, it still changes the
1032 meaning and effect of the command. In this example, no files or lines are fixed
1033 until we specify the base, but then we do fix unchanged lines.
1034
1035 $ hg init basewhole
1036 $ cd basewhole
1037 $ printf "foo1\n" > foo.changed
1038 $ hg commit -Aqm "first"
1039 $ printf "foo2\n" >> foo.changed
1040 $ printf "bar\n" > bar.changed
1041 $ hg commit -Aqm "second"
1042
1043 $ hg fix --working-dir --whole
1044 $ cat *.changed
1045 bar
1046 foo1
1047 foo2
1048
1049 $ hg fix --working-dir --base 0 --whole
1050 $ cat *.changed
1051 BAR
1052 FOO1
1053 FOO2
1054
1055 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now