X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=src%2FGit%2FTGitPath.h;h=07528fc20bcac58960cee46c8618e9a26ee93877;hb=db8464ba7371f55229c45b018760e43d1c375599;hp=130e5eeefa89f6c8896c049ec7284940dc75c93f;hpb=c31f71b877f7e82d7d7a23a66efef87e6d5e9062;p=tortoisegit%2FTortoiseGitJp.git diff --git a/src/Git/TGitPath.h b/src/Git/TGitPath.h index 130e5ee..07528fc 100644 --- a/src/Git/TGitPath.h +++ b/src/Git/TGitPath.h @@ -1,11 +1,13 @@ #pragma once +#include "gittype.h" class CTGitPath { public: CTGitPath(void); ~CTGitPath(void); - CTGitPath(const CString& sUnknownPath); + CTGitPath(const CString& sUnknownPath); + int m_Stage; public: enum { @@ -13,23 +15,46 @@ public: LOGACTIONS_MODIFIED = 0x00000002, LOGACTIONS_REPLACED = 0x00000004, LOGACTIONS_DELETED = 0x00000008, + LOGACTIONS_UNMERGED = 0x00000010, + LOGACTIONS_CACHE = 0x00000020, + LOGACTIONS_COPY = 0x00000040, + LOGACTIONS_MERGED = 0x00000080, + LOGACTIONS_FORWORD = 0x00000100, LOGACTIONS_UNVER = 0x80000000, LOGACTIONS_IGNORE = 0x40000000, - LOGACTIONS_CONFLICT = 0x20000000, + //LOGACTIONS_CONFLICT = 0x20000000, + + // For log filter only + LOGACTIONS_HIDE = 0x20000000, + LOGACTIONS_GRAY = 0x10000000, + + // For Rebase only + LOGACTIONS_REBASE_CURRENT = 0x08000000, + LOGACTIONS_REBASE_PICK = 0x04000000, + LOGACTIONS_REBASE_SQUASH = 0x02000000, + LOGACTIONS_REBASE_EDIT = 0x01000000, + LOGACTIONS_REBASE_DONE = 0x00800000, + LOGACTIONS_REBASE_SKIP = 0x00400000, + LOGACTIONS_REBASE_MASK = 0x0FC00000, + LOGACTIONS_REBASE_MODE_MASK=0x07C00000, + }; CString m_StatAdd; CString m_StatDel; int m_Action; bool m_Checked; - int ParserAction(CString action); + int ParserAction(BYTE action); CString GetActionName(); + static CString GetActionName(int action); /** * Set the path as an UTF8 string with forward slashes */ void SetFromGit(const char* pPath); void SetFromGit(const char* pPath, bool bIsDirectory); - void SetFromGit(const CString& sPath); + void SetFromGit(const TCHAR* pPath, bool bIsDirectory); + void SetFromGit(const CString& sPath,CString *OldPath=NULL); + /** * Set the path as UNICODE with backslashes */ @@ -52,6 +77,8 @@ public: * Returns the path with forward slashes. */ const CString& GetGitPathString() const; + + const CString& GetGitOldPathString() const; /** * Returns the path completely prepared to be fed the the Git APIs * It will be in UTF8, with URLs escaped, if necessary @@ -72,6 +99,9 @@ public: * Returns true if the path points to a directory */ bool IsDirectory() const; + + CTGitPath GetSubPath(CTGitPath &root); + /** * Returns the directory. If the path points to a directory, then the path * is returned unchanged. If the path points to a file, the path to the @@ -186,6 +216,12 @@ public: * contains an admin directory. */ bool HasAdminDir() const; + bool HasAdminDir(CString *ProjectTopDir) const; + bool HasSubmodules() const; + bool HasGitSVNDir() const; + bool HasStashDir() const; + + int GetAdminDirMask() const; /** * Checks if the path point to or below a Subversion admin directory (.Git). @@ -245,6 +281,12 @@ private: mutable CString m_sUIPath; mutable CStringA m_sUTF8FwdslashPath; mutable CStringA m_sUTF8FwdslashPathEscaped; + mutable CString m_sProjectRoot; + + //used for rename case + mutable CString m_sOldBackslashPath; + mutable CString m_sOldFwdslashPath; + // Have we yet determined if this is a directory or not? mutable bool m_bDirectoryKnown; mutable bool m_bIsDirectory; @@ -287,12 +329,14 @@ public: // A constructor which allows a path list to be easily built with one initial entry in explicit CTGitPathList(const CTGitPath& firstEntry); int m_Action; + public: void AddPath(const CTGitPath& newPath); bool LoadFromFile(const CTGitPath& filename); bool WriteToFile(const CString& sFilename, bool bANSI = false) const; CTGitPath * LookForGitPath(CString path); - int ParserFromLog(CString &log); + int ParserFromLog(BYTE_VECTOR &log); + int ParserFromLsFile(BYTE_VECTOR &out,bool staged=true); int FillUnRev(int Action,CTGitPathList *list=NULL); int GetAction(); /**