Mercurial > public > mercurial-scm > hg-stable
diff tests/test-record.t @ 18954:b1639e98e8a1
record: ignore trailing content when parsing patches - introduce 'other' lines
This makes record work more like import which ignores for instance mail footers
in a patch file.
This also makes it possible for TortoiseHg to preview unapplied patches
containing such footers.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 13 Jun 2012 23:06:34 +0200 |
parents | e4ae397595e8 |
children | 5e4491c114b2 |
line wrap: on
line diff
--- a/tests/test-record.t Thu Apr 11 19:03:33 2013 +0200 +++ b/tests/test-record.t Wed Jun 13 23:06:34 2012 +0200 @@ -1036,10 +1036,10 @@ $ hg up -C 0 files updated, 0 files merged, 1 files removed, 0 files unresolved -Editing patch +Editing patch (and ignoring trailing text) $ cat > editor.sh << '__EOF__' - > sed -e 7d -e '5s/^-/ /' "$1" > tmp + > sed -e 7d -e '5s/^-/ /' -e '/^# ---/itrailing\nditto' "$1" > tmp > mv tmp "$1" > __EOF__ $ cat > editedfile << '__EOF__' @@ -1201,6 +1201,8 @@ abort: error parsing patch: unhandled transition: range -> range [255] +random text in random positions is still an error + $ cat > editor.sh << '__EOF__' > sed -e '/^@/iother' "$1" > tmp > mv tmp "$1" @@ -1220,7 +1222,7 @@ +This is the second line +This line has been added record this change to 'editedfile'? [Ynesfdaq?] - abort: error parsing patch: unknown patch content: 'other\n' + abort: error parsing patch: unhandled transition: file -> other [255] $ hg up -C