MCPcopy Create free account
hub / github.com/git/git / prepareLogMessage

Method prepareLogMessage

git-p4.py:1873–1904  ·  view source on GitHub ↗

Edits the template returned from "p4 change -o" to insert the message in the Description field, and the jobs text in the Jobs field.

(self, template, message, jobs)

Source from the content-addressed store, hash-verified

1871 return (stripped_message, jobtext)
1872
1873 def prepareLogMessage(self, template, message, jobs):
1874 """Edits the template returned from "p4 change -o" to insert the
1875 message in the Description field, and the jobs text in the Jobs
1876 field.
1877 """
1878 result = ""
1879
1880 inDescriptionSection = False
1881
1882 for line in template.split("\n"):
1883 if line.startswith("#"):
1884 result += line + "\n"
1885 continue
1886
1887 if inDescriptionSection:
1888 if line.startswith("Files:") or line.startswith("Jobs:"):
1889 inDescriptionSection = False
1890 # insert Jobs section
1891 if jobs:
1892 result += jobs + "\n"
1893 else:
1894 continue
1895 else:
1896 if line.startswith("Description:"):
1897 inDescriptionSection = True
1898 line += "\n"
1899 for messageLine in message.split("\n"):
1900 line += "\t" + messageLine + "\n"
1901
1902 result += line + "\n"
1903
1904 return result
1905
1906 def patchRCSKeywords(self, file, regexp):
1907 """Attempt to zap the RCS keywords in a p4 controlled file matching the

Callers 1

applyCommitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected