diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-11-11 16:27:23 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2014-11-13 09:10:22 +0100 |
commit | 9605244f6d73aced9ec33eea105030ae23eea896 (patch) | |
tree | ec52b6659c211c36be2c07beecd09b1e2aef9132 /src/plugins/diffeditor/diffutils.h | |
parent | e123f5a4d9ec164073d75fd926acadd9d4b2243b (diff) |
DiffEditor: Save description along with diff.
Save complete, git-applicable patch when saving the result of
for example 'git show'. Strips some Creator-specific tags
off the description and reformats the description such
that it is accepted by git.
Change-Id: I739d85a7263f97e2149a2794974ba026f2eca067
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/diffeditor/diffutils.h')
-rw-r--r-- | src/plugins/diffeditor/diffutils.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/diffeditor/diffutils.h b/src/plugins/diffeditor/diffutils.h index bb0d3ed0d48..ee74f9672a2 100644 --- a/src/plugins/diffeditor/diffutils.h +++ b/src/plugins/diffeditor/diffutils.h @@ -130,6 +130,10 @@ public: class DIFFEDITOR_EXPORT DiffUtils { public: + enum PatchFormattingFlags { + AddLevel = 0x1, // Add 'a/' , '/b' for git am + GitFormat = AddLevel | 0x2, // Add line 'diff ..' as git does + }; static ChunkData calculateOriginalData(const QList<Diff> &leftDiffList, const QList<Diff> &rightDiffList); @@ -146,7 +150,8 @@ public: const QString &leftFileName, const QString &rightFileName, bool lastChunk = false); - static QString makePatch(const QList<FileData> &fileDataList); + static QString makePatch(const QList<FileData> &fileDataList, + unsigned formatFlags = 0); static QList<FileData> readPatch(const QString &patch, bool *ok = 0); }; |