Merge compiz:mitya57/bzr-to-git-2 into compiz:master

Proposed by Dmitry Shachnev
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 1b5cf3b6c02fd1329dc553cd5ad6d9bd94ce7f30
Merged at revision: a575e2be187a156534047c94a7c370b207b9b597
Proposed branch: compiz:mitya57/bzr-to-git-2
Merge into: compiz:master
Diff against target: 257 lines (+10/-219)
2 files modified
cmake/CompizCommon.cmake (+10/-4)
dev/null (+0/-215)
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Alberts Muktupāvels Approve
Compiz Maintainers Pending
Review via email: mp+363236@code.launchpad.net

Description of the change

Remove the remaining usage of Bzr.

- bzr add → git add;
- bzr config email → git config user.name + git config user.email;
- Also replaced $ENV{EDITOR} with editor, the former was not defined for me and was causing ‘Permission denied’ error because the command was just ‘./NEWS.update’;
- Removed scripts/release.py, it was not used for the last releases, and CompizCommon.cmake has targets that provide equivalent functionality.

To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) :
review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ack

review: Approve
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cmake/CompizCommon.cmake b/cmake/CompizCommon.cmake
2index e48da17..0d61881 100644
3--- a/cmake/CompizCommon.cmake
4+++ b/cmake/CompizCommon.cmake
5@@ -325,8 +325,8 @@ macro (compiz_add_release_signoff)
6 add_custom_target (release-signoff)
7
8 add_custom_target (release-update-working-tree
9- COMMAND cp NEWS ${CMAKE_SOURCE_DIR} && bzr add ${CMAKE_SOURCE_DIR}/NEWS &&
10- cp AUTHORS ${CMAKE_SOURCE_DIR} && bzr add ${CMAKE_SOURCE_DIR}/AUTHORS
11+ COMMAND cp NEWS ${CMAKE_SOURCE_DIR} && git add ${CMAKE_SOURCE_DIR}/NEWS &&
12+ cp AUTHORS ${CMAKE_SOURCE_DIR} && git add ${CMAKE_SOURCE_DIR}/AUTHORS
13 COMMENT "Updating working tree"
14 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
15
16@@ -397,12 +397,18 @@ macro (compiz_add_release)
17 if (AUTO_NEWS_UPDATE)
18
19 add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
20- COMMAND echo \"Release ${VERSION} \(`date +%Y-%m-%d` `bzr config email`\)\" > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s \"=\" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo '${AUTO_NEWS_UPDATE}' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
21+ COMMAND echo \"Release ${VERSION} \(`date +%Y-%m-%d` `git config user.name` <`git config user.email`>\)\" > ${CMAKE_BINARY_DIR}/NEWS.update
22+ && seq -s \"=\" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update
23+ && echo '${AUTO_NEWS_UPDATE}' >> ${CMAKE_BINARY_DIR}/NEWS.update
24+ && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
25 COMMENT "Generating NEWS Header"
26 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
27 else (AUTO_NEWS_UPDATE)
28 add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
29- COMMAND echo \"Release ${VERSION} \(`date +%Y-%m-%d` `bzr config email`\)\" > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
30+ COMMAND echo \"Release ${VERSION} \(`date +%Y-%m-%d` `git config user.name` <`git config user.email`>\)\" > ${CMAKE_BINARY_DIR}/NEWS.update
31+ && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update
32+ && editor ${CMAKE_BINARY_DIR}/NEWS.update
33+ && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
34 COMMENT "Generating NEWS Header"
35 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
36 endif (AUTO_NEWS_UPDATE)
37diff --git a/scripts/release.py b/scripts/release.py
38deleted file mode 100644
39index 2acc50c..0000000
40--- a/scripts/release.py
41+++ /dev/null
42@@ -1,215 +0,0 @@
43-#!/usr/env/python
44-# Usage: release.py VERSION. Creates a new compiz release and bumps VERSION
45-# to the next release
46-#
47-# Copyright (c) Sam Spilsbury <smspillaz@gmail.com>
48-#
49-# This program is free software; you can redistribute it and/or modify
50-# it under the terms of the GNU General Public License as published by
51-# the Free Software Foundation; either version 2 of the License, or
52-# (at your option) any later version.
53-#
54-# This program is distributed in the hope that it will be useful,
55-# but WITHOUT ANY WARRANTY; without even the implied warranty of
56-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57-# GNU General Public License for more details.
58-#
59-# You should have received a copy of the GNU General Public License
60-# along with this program; if not, write to the Free Software
61-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
62-import sys
63-import os
64-import bzrlib.branch
65-import bzrlib.workingtree
66-import bzrlib.errors as errors
67-from launchpadlib.launchpad import Launchpad
68-import datetime
69-
70-def usage ():
71- print ("release.py VERSION [SINCE]")
72- print ("Make a release and bump version to VERSION")
73- sys.exit (1)
74-
75-if len(sys.argv) < 2:
76- usage ()
77-
78-if not "release.py" in os.listdir ("."):
79- print ("Working directory must contain this script")
80- sys.exit (1)
81-
82-editor = ""
83-
84-try:
85- editor = os.environ["EDITOR"]
86-except KeyError:
87- print ("EDITOR must be set")
88- sys.exit (1)
89-
90-if len (editor) == 0:
91- print ("EDITOR must be set")
92- sys.exit (1)
93-
94-bzrlib.initialize ()
95-compiz_branch = bzrlib.branch.Branch.open ("..")
96-compiz_branch.lock_read ()
97-tags = compiz_branch.tags.get_tag_dict ().items ()
98-
99-most_recent_revision = 0
100-
101-since = None
102-
103-if len (sys.argv) == 3:
104- since = sys.argv[2];
105-
106-# Find the last tagged revision or the specified tag
107-for tag, revid in tags:
108- try:
109- revision = compiz_branch.revision_id_to_dotted_revno (revid)[0]
110-
111- if since != None:
112- if tag == since:
113- most_recent_revision = revision
114-
115- elif int (revision) > most_recent_revision:
116- most_recent_revision = revision
117-
118- except (errors.NoSuchRevision,
119- errors.GhostRevisionsHaveNoRevno,
120- errors.UnsupportedOperation):
121- pass
122-
123-repo = compiz_branch.repository
124-release_revisions = []
125-
126-# Find all revisions since that one
127-for revision_id in repo.get_revisions (repo.all_revision_ids ()):
128- try:
129- revno = compiz_branch.revision_id_to_dotted_revno (revision_id.revision_id)[0]
130-
131- if revno > most_recent_revision:
132- release_revisions.append (revision_id)
133-
134- except (errors.NoSuchRevision,
135- errors.GhostRevisionsHaveNoRevno,
136- errors.UnsupportedOperation):
137- pass
138-
139-# Find all fixed bugs in those revisions
140-bugs = []
141-
142-for rev in release_revisions:
143- for bug in rev.iter_bugs():
144- bugs.append (bug[0][27:])
145-
146-bugs = sorted (bugs)
147-
148-# Connect to launchpad
149-lp = Launchpad.login_anonymously ("Compiz Release Script", "production")
150-
151-# Create a pretty looking formatted list of bugs
152-bugs_formatted = []
153-
154-for bug in bugs:
155- lpBug = lp.bugs[bug]
156- bugTitle = lpBug.title
157-
158- bugTitleWords = bugTitle.split (" ")
159- maximumLineLength = 65
160- currentLineLength = 0
161- line = 0
162- lineParts = [""]
163-
164- for word in bugTitleWords:
165- wordLength = len (word) + 1
166- if wordLength + currentLineLength > maximumLineLength:
167- lineParts.append ("")
168- line = line + 1
169- currentLineLength = 0
170- elif currentLineLength != 0:
171- lineParts[line] += " "
172-
173- currentLineLength += wordLength
174- lineParts[line] += (word)
175-
176- bugs_formatted.append ((bug, lineParts))
177-
178-# Pretty-print the bugs
179-bugs_formatted_msg = ""
180-
181-for bug, lines in bugs_formatted:
182- whitespace = " " * (12 - len (bug))
183- bugs_formatted_msg += whitespace + bug + " - " + lines[0] + "\n"
184-
185- if len (lines) > 1:
186- for i in range (1, len (lines)):
187- whitespace = " " * 15
188- bugs_formatted_msg += whitespace + lines[i] + "\n"
189-
190-# Get the version
191-version_file = open ("../VERSION", "r")
192-version = version_file.readlines ()[0][:-1]
193-version_file.close ()
194-
195-# Get the date
196-date = datetime.datetime.now ()
197-date_formatted = str(date.year) + "-" + str(date.month) + "-" + str(date.day)
198-
199-# Create release message
200-release_msg = "Release " + version + " (" + date_formatted + " NAME <EMAIL>)\n"
201-release_msg += "=" * 77 + "\n\n"
202-release_msg += "Highlights\n\n"
203-release_msg += "Bugs Fixed (https://launchpad.net/compiz/+milestone/" + version + ")\n\n"
204-release_msg += bugs_formatted_msg
205-
206-print release_msg
207-
208-# Edit release message
209-news_update_file = open (".release-script-" + version, "w+")
210-news_update_file.write (release_msg.encode ("utf8"))
211-news_update_file.close ()
212-
213-os.system (editor + " .release-script-" + version)
214-
215-# Open NEWS
216-news_file = open ("../NEWS", "r")
217-news_lines = news_file.readlines ()
218-news_prepend_file = open (".release-script-" + version, "r")
219-news_prepend_lines = news_prepend_file.readlines ()
220-
221-for i in range (0, len (news_prepend_lines)):
222- news_prepend_lines[i] = news_prepend_lines[i].decode ("utf8")
223-
224-news_prepend_lines.append ("\n")
225-
226-for line in news_lines:
227- news_prepend_lines.append (line.decode ("utf8"))
228-
229-news = ""
230-
231-for line in news_prepend_lines:
232- news += line
233-
234-news_file.close ()
235-news_prepend_file.close ()
236-news_file = open ("../NEWS", "w")
237-news_file.write (news.encode ("utf8"))
238-news_file.close ()
239-
240-# Commit
241-compiz_tree = bzrlib.workingtree.WorkingTree.open ("..")
242-compiz_tree.commit ("Release version " + version)
243-
244-# Create a tag
245-compiz_branch.unlock ()
246-compiz_branch.lock_write ()
247-compiz_branch.tags.set_tag ("v" + version, compiz_branch.last_revision ())
248-compiz_branch.unlock ()
249-
250-# Update version
251-version_file = open ("../VERSION", "w")
252-version_file.write (sys.argv[1] + "\n")
253-version_file.close ()
254-
255-# Commit
256-compiz_tree = bzrlib.workingtree.WorkingTree.open ("..")
257-compiz_tree.commit ("Bump VERSION to " + sys.argv[1])

Subscribers

People subscribed via source and target branches