Show More
@@ -4,7 +4,7 b' jury-rigged fashion.' | |||||
4 | It has the following prerequisites, at least as I build it: |
|
4 | It has the following prerequisites, at least as I build it: | |
5 |
|
5 | |||
6 | Python for Windows |
|
6 | Python for Windows | |
7 |
http://www.python.org/ftp/python/2.4. |
|
7 | http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi | |
8 |
|
8 | |||
9 | MinGW |
|
9 | MinGW | |
10 | http://www.mingw.org/ |
|
10 | http://www.mingw.org/ | |
@@ -21,7 +21,7 b' It has the following prerequisites, at l' | |||||
21 | Inno Setup |
|
21 | Inno Setup | |
22 | http://www.jrsoftware.org/isinfo.php |
|
22 | http://www.jrsoftware.org/isinfo.php | |
23 |
|
23 | |||
24 | ISTool |
|
24 | ISTool - optional | |
25 | http://www.istool.org/default.aspx/ |
|
25 | http://www.istool.org/default.aspx/ | |
26 |
|
26 | |||
27 | add_path (you need only add_path.exe in the zip file) |
|
27 | add_path (you need only add_path.exe in the zip file) | |
@@ -35,13 +35,37 b' C:\\hg\\hg-release.' | |||||
35 |
|
35 | |||
36 | In a shell, build a standalone copy of the hg.exe program: |
|
36 | In a shell, build a standalone copy of the hg.exe program: | |
37 |
|
37 | |||
38 |
python setup.py build -c mingw32 |
|
38 | python setup.py build -c mingw32 | |
|
39 | python setup.py py2exe -b 1 | |||
|
40 | ||||
|
41 | Note: the previously suggested combined command of "python setup.py build -c | |||
|
42 | mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the | |||
|
43 | extensions in the mercurial subdirectory. | |||
39 |
|
44 | |||
40 | Copy mfc71.dll and add_path.exe into the dist directory that just |
|
45 | If you want to create a file named setup.cfg with the contents: | |
41 | got created. |
|
46 | ||
|
47 | [build] | |||
|
48 | compiler=mingw32 | |||
|
49 | ||||
|
50 | you can skip the first build step. | |||
|
51 | ||||
|
52 | Copy mfc71.dll and add_path.exe into the dist directory that just got created. | |||
42 |
|
53 | |||
43 |
|
|
54 | If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss | |
44 | file. |
|
55 | file and type Ctrl-F9 to compile the installer file. | |
|
56 | ||||
|
57 | Otherwise you run the Inno Setup compiler. Assuming it's on the path you run: | |||
|
58 | ||||
|
59 | iscc contrib\win32\mercurial.iss | |||
|
60 | ||||
|
61 | The actual installer will be in the C:\hg\hg-release\Output directory. | |||
45 |
|
62 | |||
46 | In ISTool, type Ctrl-F9 to compile the installer file. The actual |
|
63 | To automate the steps above you may want to create a batchfile based on the | |
47 | installer will be in the C:\hg\hg-release\Output directory. |
|
64 | following: | |
|
65 | ||||
|
66 | echo [build] > setup.cfg | |||
|
67 | echo compiler=mingw32 >> setup.cfg | |||
|
68 | python setup.py py2exe -b 1 | |||
|
69 | iscc contrib\win32\mercurial.iss | |||
|
70 | ||||
|
71 | and run it from the root of the hg repository (c:\hg\hg-release). |
@@ -102,6 +102,27 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
102 | Find moves and copies between m1 and m2 back to limit linkrev |
|
102 | Find moves and copies between m1 and m2 back to limit linkrev | |
103 | """ |
|
103 | """ | |
104 |
|
104 | |||
|
105 | def nonoverlap(d1, d2, d3): | |||
|
106 | "Return list of elements in d1 not in d2 or d3" | |||
|
107 | l = [d for d in d1 if d not in d3 and d not in d2] | |||
|
108 | l.sort() | |||
|
109 | return l | |||
|
110 | ||||
|
111 | def dirname(f): | |||
|
112 | s = f.rfind("/") | |||
|
113 | if s == -1: | |||
|
114 | return "" | |||
|
115 | return f[:s] | |||
|
116 | ||||
|
117 | def dirs(files): | |||
|
118 | d = {} | |||
|
119 | for f in files: | |||
|
120 | f = dirname(f) | |||
|
121 | while f not in d: | |||
|
122 | d[f] = True | |||
|
123 | f = dirname(f) | |||
|
124 | return d | |||
|
125 | ||||
105 | def findold(fctx): |
|
126 | def findold(fctx): | |
106 | "find files that path was copied from, back to linkrev limit" |
|
127 | "find files that path was copied from, back to linkrev limit" | |
107 | old = {} |
|
128 | old = {} | |
@@ -124,33 +145,25 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
124 | old.sort() |
|
145 | old.sort() | |
125 | return old |
|
146 | return old | |
126 |
|
147 | |||
127 | def nonoverlap(d1, d2, d3): |
|
148 | copy = {} | |
128 | "Return list of elements in d1 not in d2 or d3" |
|
149 | fullcopy = {} | |
129 | l = [d for d in d1 if d not in d3 and d not in d2] |
|
|||
130 | l.sort() |
|
|||
131 | return l |
|
|||
132 |
|
150 | |||
133 | def checkcopies(c, man): |
|
151 | def checkcopies(c, man): | |
134 | '''check possible copies for filectx c''' |
|
152 | '''check possible copies for filectx c''' | |
135 | for of in findold(c): |
|
153 | for of in findold(c): | |
136 | if of not in man: |
|
154 | if of not in man: # original file not in other manifest? | |
137 | continue |
|
155 | continue | |
138 | c2 = ctx(of, man[of]) |
|
156 | c2 = ctx(of, man[of]) | |
139 | ca = c.ancestor(c2) |
|
157 | ca = c.ancestor(c2) | |
140 | if not ca: # unrelated |
|
158 | if not ca: # unrelated? | |
141 | continue |
|
159 | continue | |
|
160 | # named changed on only one side? | |||
142 | if ca.path() == c.path() or ca.path() == c2.path(): |
|
161 | if ca.path() == c.path() or ca.path() == c2.path(): | |
143 | fullcopy[c.path()] = of |
|
162 | fullcopy[c.path()] = of # remember for dir rename detection | |
144 |
if c == |
|
163 | if c == c2: # no merge needed, ignore copy | |
145 | continue |
|
164 | continue | |
146 | copy[c.path()] = of |
|
165 | copy[c.path()] = of | |
147 |
|
166 | |||
148 | def dirs(files): |
|
|||
149 | d = {} |
|
|||
150 | for f in files: |
|
|||
151 | d[os.path.dirname(f)] = True |
|
|||
152 | return d |
|
|||
153 |
|
||||
154 | if not repo.ui.configbool("merge", "followcopies", True): |
|
167 | if not repo.ui.configbool("merge", "followcopies", True): | |
155 | return {} |
|
168 | return {} | |
156 |
|
169 | |||
@@ -159,8 +172,6 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
159 | return {} |
|
172 | return {} | |
160 |
|
173 | |||
161 | dcopies = repo.dirstate.copies() |
|
174 | dcopies = repo.dirstate.copies() | |
162 | copy = {} |
|
|||
163 | fullcopy = {} |
|
|||
164 | u1 = nonoverlap(m1, m2, ma) |
|
175 | u1 = nonoverlap(m1, m2, ma) | |
165 | u2 = nonoverlap(m2, m1, ma) |
|
176 | u2 = nonoverlap(m2, m1, ma) | |
166 | ctx = util.cachefunc(lambda f, n: repo.filectx(f, fileid=n[:20])) |
|
177 | ctx = util.cachefunc(lambda f, n: repo.filectx(f, fileid=n[:20])) | |
@@ -179,28 +190,41 b' def findcopies(repo, m1, m2, ma, limit):' | |||||
179 | invalid = {} |
|
190 | invalid = {} | |
180 | dirmove = {} |
|
191 | dirmove = {} | |
181 |
|
192 | |||
|
193 | # examine each file copy for a potential directory move, which is | |||
|
194 | # when all the files in a directory are moved to a new directory | |||
182 | for dst, src in fullcopy.items(): |
|
195 | for dst, src in fullcopy.items(): | |
183 |
dsrc, ddst = |
|
196 | dsrc, ddst = dirname(src), dirname(dst) | |
184 | if dsrc in invalid: |
|
197 | if dsrc in invalid: | |
|
198 | # already seen to be uninteresting | |||
185 | continue |
|
199 | continue | |
186 |
elif |
|
200 | elif dsrc in d1 and ddst in d1: | |
|
201 | # directory wasn't entirely moved locally | |||
|
202 | invalid[dsrc] = True | |||
|
203 | elif dsrc in d2 and ddst in d2: | |||
|
204 | # directory wasn't entirely moved remotely | |||
187 | invalid[dsrc] = True |
|
205 | invalid[dsrc] = True | |
188 | elif dsrc in dirmove and dirmove[dsrc] != ddst: |
|
206 | elif dsrc in dirmove and dirmove[dsrc] != ddst: | |
|
207 | # files from the same directory moved to two different places | |||
189 | invalid[dsrc] = True |
|
208 | invalid[dsrc] = True | |
190 | del dirmove[dsrc] |
|
|||
191 | else: |
|
209 | else: | |
|
210 | # looks good so far | |||
192 | dirmove[dsrc + "/"] = ddst + "/" |
|
211 | dirmove[dsrc + "/"] = ddst + "/" | |
193 |
|
212 | |||
|
213 | for i in invalid: | |||
|
214 | if i in dirmove: | |||
|
215 | del dirmove[i] | |||
|
216 | ||||
194 | del d1, d2, invalid |
|
217 | del d1, d2, invalid | |
195 |
|
218 | |||
196 | if not dirmove: |
|
219 | if not dirmove: | |
197 | return copy |
|
220 | return copy | |
198 |
|
221 | |||
199 | # check unaccounted nonoverlapping files |
|
222 | # check unaccounted nonoverlapping files against directory moves | |
200 | for f in u1 + u2: |
|
223 | for f in u1 + u2: | |
201 | if f not in fullcopy: |
|
224 | if f not in fullcopy: | |
202 | for d in dirmove: |
|
225 | for d in dirmove: | |
203 | if f.startswith(d): |
|
226 | if f.startswith(d): | |
|
227 | # new file added in a directory that was moved, move it | |||
204 | copy[f] = dirmove[d] + f[len(d):] |
|
228 | copy[f] = dirmove[d] + f[len(d):] | |
205 | break |
|
229 | break | |
206 |
|
230 |
General Comments 0
You need to be logged in to leave comments.
Login now