##// END OF EJS Templates
record: fix revert -i for lines without newline (issue5651)...
Jun Wu -
r33941:5707bfe0 stable
parent child Browse files
Show More
@@ -972,7 +972,7 b' class recordhunk(object):'
972 that, swap fromline/toline and +/- signs while keep other things
972 that, swap fromline/toline and +/- signs while keep other things
973 unchanged.
973 unchanged.
974 """
974 """
975 m = {'+': '-', '-': '+'}
975 m = {'+': '-', '-': '+', '\\': '\\'}
976 hunk = ['%s%s' % (m[l[0]], l[1:]) for l in self.hunk]
976 hunk = ['%s%s' % (m[l[0]], l[1:]) for l in self.hunk]
977 return recordhunk(self.header, self.toline, self.fromline, self.proc,
977 return recordhunk(self.header, self.toline, self.fromline, self.proc,
978 self.before, hunk, self.after)
978 self.before, hunk, self.after)
@@ -460,3 +460,40 b' Check the experimental config to invert '
460 forget added file newfile (Yn)? y
460 forget added file newfile (Yn)? y
461 $ hg status
461 $ hg status
462 ? newfile
462 ? newfile
463
464 When a line without EOL is selected during "revert -i" (issue5651)
465
466 $ cat <<EOF >> $HGRCPATH
467 > [experimental]
468 > %unset revertalternateinteractivemode
469 > EOF
470
471 $ hg init $TESTTMP/revert-i-eol
472 $ cd $TESTTMP/revert-i-eol
473 $ echo 0 > a
474 $ hg ci -qAm 0
475 $ printf 1 >> a
476 $ hg ci -qAm 1
477 $ cat a
478 0
479 1 (no-eol)
480
481 $ hg revert -ir'.^' <<EOF
482 > y
483 > y
484 > EOF
485 reverting a
486 diff --git a/a b/a
487 1 hunks, 1 lines changed
488 examine changes to 'a'? [Ynesfdaq?] y
489
490 @@ -1,1 +1,2 @@
491 0
492 +1
493 \ No newline at end of file
494 revert this change to 'a'? [Ynesfdaq?] y
495
496 $ cat a
497 0
498
499 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now