From f8e5d57fe36843ab92607a3a473c4d52c52b9f07 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 28 Nov 2005 01:30:16 +0000 Subject: - Oops, the /dev/null "fix" broke create-delete.test. Back out this change and fix only the specific -p0 case. --- po/de.po | 10 +++++----- po/fr.po | 10 +++++----- po/ja.po | 10 +++++----- po/quilt.pot | 10 +++++----- quilt.changes | 13 +++++-------- scripts/patchfns.in | 4 ++++ test/null-bug.test | 11 +++++++++++ 7 files changed, 40 insertions(+), 28 deletions(-) diff --git a/po/de.po b/po/de.po index ca68eed..cc00b1c 100644 --- a/po/de.po +++ b/po/de.po @@ -95,7 +95,7 @@ msgstr "Patch %s ist nicht in der series-Datei enthalten\\n" msgid "Patch %s is not applied\\n" msgstr "Patch %s ist nicht angewandt\\n" -#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:103 +#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:102 #: quilt/fold.in:79 quilt/fork.in:72 quilt/graph.in:131 quilt/header.in:142 #: quilt/pop.in:282 quilt/push.in:350 quilt/refresh.in:162 quilt/remove.in:81 #: quilt/rename.in:85 @@ -334,7 +334,7 @@ msgstr "" "Kann kein Diff mit -p$opt_strip_level erzeugen, bitte -p0 oder -p1 verwenden." "\\n" -#: quilt/diff.in:294 quilt/files.in:122 +#: quilt/diff.in:294 quilt/files.in:121 msgid "Patch %s not applied before patch %s\\n" msgstr "Patch %s ist nicht vor Patch %s angewandt\\n" @@ -409,7 +409,7 @@ msgstr "" "\tersten angewandten Patch.\n" "\n" -#: quilt/files.in:76 quilt/files.in:96 +#: quilt/files.in:76 quilt/files.in:95 msgid "Patch %s is not in series file\\n" msgstr "Patch %s ist nicht in der series-Datei enthalten\\n" @@ -1390,7 +1390,7 @@ msgstr "Datei %s ist verschwunden\n" msgid "Failed to rename %s to %s: %s\n" msgstr "Konnte %s nicht auf %s umbenennen: %s\n" -#: scripts/patchfns.in:700 +#: scripts/patchfns.in:703 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1403,7 +1403,7 @@ msgstr "" "quilt alle Patches mit der Version von quilt, die zur Erstellung des " "Arbeitsverzeichnisses verwendet wurde.\\n" -#: scripts/patchfns.in:785 +#: scripts/patchfns.in:788 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/fr.po b/po/fr.po index 253bdea..0b87ada 100644 --- a/po/fr.po +++ b/po/fr.po @@ -95,7 +95,7 @@ msgstr "Le patch %s n'est pas dans la s msgid "Patch %s is not applied\\n" msgstr "Le patch %s n'est pas appliqué\\n" -#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:103 +#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:102 #: quilt/fold.in:79 quilt/fork.in:72 quilt/graph.in:131 quilt/header.in:142 #: quilt/pop.in:282 quilt/push.in:350 quilt/refresh.in:162 quilt/remove.in:81 #: quilt/rename.in:85 @@ -330,7 +330,7 @@ msgstr "" "Impossible de créer des patches avec -p%s. Veuillez spécifier -p0 ou -p1 à " "la place\\n" -#: quilt/diff.in:294 quilt/files.in:122 +#: quilt/diff.in:294 quilt/files.in:121 msgid "Patch %s not applied before patch %s\\n" msgstr "Le patch %s n'est pas appliqué avant %s\\n." @@ -404,7 +404,7 @@ msgstr "" "\tcelui appliqué en dernier. Le nom de fichier « - » correspond au \n" "\tpremier patch appliqué.\n" -#: quilt/files.in:76 quilt/files.in:96 +#: quilt/files.in:76 quilt/files.in:95 msgid "Patch %s is not in series file\\n" msgstr "Le patch %s n'est pas dans le fichier series\\n" @@ -1401,7 +1401,7 @@ msgstr "Le fichier %s a disparu !\n" msgid "Failed to rename %s to %s: %s\n" msgstr "Impossible de renommer %s en %s : %s\n" -#: scripts/patchfns.in:700 +#: scripts/patchfns.in:703 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1413,7 +1413,7 @@ msgstr "" "format %s (inclus). Veuillez retirer vos patches avec la version \n" "utilisée pour les appliquer avant d'installer une version plus ancienne.\\n" -#: scripts/patchfns.in:785 +#: scripts/patchfns.in:788 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/ja.po b/po/ja.po index e489c62..55d4dbf 100644 --- a/po/ja.po +++ b/po/ja.po @@ -93,7 +93,7 @@ msgstr "パッム%s 㯠seriesã®ä¸­ã«ã‚ã‚Šã¾ã›ã‚“\\n" msgid "Patch %s is not applied\\n" msgstr "パッム%s ã¯é©ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“\\n" -#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:103 +#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:102 #: quilt/fold.in:79 quilt/fork.in:72 quilt/graph.in:131 quilt/header.in:142 #: quilt/pop.in:282 quilt/push.in:350 quilt/refresh.in:162 quilt/remove.in:81 #: quilt/rename.in:85 @@ -324,7 +324,7 @@ msgstr "" msgid "Cannot diff patches with -p%s, please specify -p0 or -p1 instead\\n" msgstr "-p%sã§ãƒ‘ッãƒã®å·®åˆ†ã¯ã¨ã‚Œã¾ã›ã‚“。-p0ã‹ -p1を指定ã—ã¦ãã ã•ã„\\n" -#: quilt/diff.in:294 quilt/files.in:122 +#: quilt/diff.in:294 quilt/files.in:121 msgid "Patch %s not applied before patch %s\\n" msgstr "パッム%s ã¯ã€ãƒ‘ッム%s ã®å‰ã«é©ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“\\n" @@ -398,7 +398,7 @@ msgstr "" "\tã“ã¨ã«ãªã‚‹ã€‚\n" "\n" -#: quilt/files.in:76 quilt/files.in:96 +#: quilt/files.in:76 quilt/files.in:95 msgid "Patch %s is not in series file\\n" msgstr "パッム%s 㯠seriesã®ä¸­ã«ã‚ã‚Šã¾ã›ã‚“\\n" @@ -1362,7 +1362,7 @@ msgstr "ファイル %s ãŒæ¶ˆãˆã¾ã—ãŸ!\n" msgid "Failed to rename %s to %s: %s\n" msgstr "パッム%s ã‹ã‚‰ %sã¸ã®åå‰ã®å¤‰æ›´ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n" -#: scripts/patchfns.in:700 +#: scripts/patchfns.in:703 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -1374,7 +1374,7 @@ msgstr "" "ã¦ã„ã¾ã›ã‚“。ダウングレードã™ã‚‹å‰ã«ã€pushã—ãŸãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® quiltを使ã£ã¦ã€\n" "ã™ã¹ã¦ã®ãƒ‘ッãƒã‚’ pop ã—ã¦ãã ã•ã„。\\n" -#: scripts/patchfns.in:785 +#: scripts/patchfns.in:788 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/po/quilt.pot b/po/quilt.pot index e8c1f9a..aad45f3 100644 --- a/po/quilt.pot +++ b/po/quilt.pot @@ -59,7 +59,7 @@ msgstr "" msgid "Patch %s is not applied\\n" msgstr "" -#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:103 +#: quilt/add.in:106 quilt/delete.in:88 quilt/diff.in:248 quilt/files.in:102 #: quilt/fold.in:79 quilt/fork.in:72 quilt/graph.in:131 quilt/header.in:142 #: quilt/pop.in:282 quilt/push.in:350 quilt/refresh.in:162 quilt/remove.in:81 #: quilt/rename.in:85 @@ -224,7 +224,7 @@ msgstr "" msgid "Cannot diff patches with -p%s, please specify -p0 or -p1 instead\\n" msgstr "" -#: quilt/diff.in:294 quilt/files.in:122 +#: quilt/diff.in:294 quilt/files.in:121 msgid "Patch %s not applied before patch %s\\n" msgstr "" @@ -281,7 +281,7 @@ msgid "" "\n" msgstr "" -#: quilt/files.in:76 quilt/files.in:96 +#: quilt/files.in:76 quilt/files.in:95 msgid "Patch %s is not in series file\\n" msgstr "" @@ -978,7 +978,7 @@ msgstr "" msgid "Failed to rename %s to %s: %s\n" msgstr "" -#: scripts/patchfns.in:700 +#: scripts/patchfns.in:703 msgid "" "The quilt meta-data in this tree has version %s, but this version of quilt " "can only handle meta-data formats up to and including version %s. Please pop " @@ -986,7 +986,7 @@ msgid "" "downgrading.\\n" msgstr "" -#: scripts/patchfns.in:785 +#: scripts/patchfns.in:788 msgid "" "The working tree was created by an older version of quilt. Please run 'quilt " "upgrade'.\\n" diff --git a/quilt.changes b/quilt.changes index 8c1cecb..b77d45c 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,14 +1,11 @@ ------------------------------------------------------------------- Mon Nov 28 01:34:05 CET 2005 - agruen@suse.de -- quilt/diff.in, quilt/refresh.in: stop using /dev/null for added - or removed files: GNU diff does not do that either, and for - removed files this leads to headers that only reference - $file.orig and /dev/null, so the actual file is not found. (This - is only truly fixes -p0 style patches as -p1 style patches use - dir.orig/file instead of dir/file.orig so the filename is not - lost, but stopping to use /dev/null makes sense for -p style - patches just the same. +- quilt/diff.in, quilt/refresh.in: for -p0 style patches, when a + file is being deleted, use the real filename in the +++ line + instead of filename.orig: if we don't, the patch does not + contain the real filename anymore, and patch will fail. See + test/null-bug.test. - files command: remove a redundant find_patch(). - Make top_patch() fail if there is no top patch. diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 714c7a6..b74cce5 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -539,6 +539,7 @@ diff_file() if ! [ -s "$old_file" ] then old_file=/dev/null + old_hdr=/dev/null [ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \ || old_date=$'\t'"1970-01-01 00:00:00.000000000 +0000" else @@ -548,7 +549,10 @@ diff_file() fi if ! [ -s "$new_file" ] then + [ $opt_strip_level -eq 0 ] \ + && old_hdr=$new_hdr new_file=/dev/null + new_hdr=/dev/null [ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \ || new_date=$'\t'"1970-01-01 00:00:00.000000000 +0000" else diff --git a/test/null-bug.test b/test/null-bug.test index 324690a..b8ad46e 100644 --- a/test/null-bug.test +++ b/test/null-bug.test @@ -8,7 +8,18 @@ $ quilt add file > File file added to patch patches/remove.diff +In this case, the original file in the --- line must not have .orig appended +or else patch won't know the real original filename anymore. + $ rm file + $ quilt diff -p0 + > Index: file + > =================================================================== + > --- file + > +++ /dev/null + > @@ -1 +0,0 @@ + > -file + $ quilt ref -p0 > Refreshed patch patches/remove.diff -- cgit