Kiln » Kiln Extensions
Clone URL:  
Pushed to 2 repositories · View In Graph Contained in tip

Kiln 3.0.156 Extensions

Changeset c6b44e175bf4

Parent 2b92642bde25

by Profile picture of William ZimrinWilliam Zimrin

Changes to 15 files · Browse files at c6b44e175bf4 Showing diff from parent 2b92642bde25 Diff from another changeset...

 
20
21
22
23
 
 
24
25
26
27
28
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
31
32
 
57
58
59
60
 
 
 
 
 
 
 
 
 
20
21
22
 
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
80
81
82
 
83
84
85
86
87
88
89
90
@@ -20,13 +20,36 @@
 version.  '''   -from mercurial import commands, localrepo, wireproto +from mercurial import commands, localrepo, wireproto, util, __version__ +import re  from mercurial.hgweb import hgweb_mod    import bfsetup  import bfcommands  import bfproto   +@apply +def _HG_VERSION(): + '''return the mercurial version as a tuple rather than a string + + Python does the right thing when comparing tuples, so the return + value can be used to compare and detect versions. + ''' + version = [0, 0, 0] + parts = [re.match(r'\d+', v).group(0) for v in __version__.version.split('.')[:3]] + for i, part in enumerate(map(int, parts)): + version[i] = part + return tuple(version) + + +if _HG_VERSION >= (3, 0, 0): + raise util.Abort( + 'kbfiles is deprecated, and does not work with recent version of Mercurial. ' + 'Please use the largefiles extension instead. ' + 'You will need to undo your Mercurial update and follow the directions at ' + 'http://help.fogcreek.com/8168/how-to-use-the-mercurial-largefiles-extension#How_do_I_perform_the_conversion_from_KBFiles_to_LargeFiles ' + 'to convert existing repositories that use kbfiles.') +  reposetup = bfsetup.reposetup  uisetup = bfsetup.uisetup   @@ -57,4 +80,11 @@
  wireproto.capabilities = bfproto.capabilities   wireproto.dispatch = bfproto.dispatch   - localrepo.localrepository.supported |= set(['kbfiles']) + try: + localrepo.localrepository.supported |= set(['kbfiles']) + except AttributeError: + pass + +def featuresetup(ui, supported): + # don't die on seeing a repo with the largefiles requirement + supported |= set(['kbfiles'])
Change 1 of 1 Show Entire File caseguard.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
@@ -1,175 +1,1 @@
-# Portions copyright (C) 2011 Fog Creek Software. -# Portions copyright (C) 2010 Alexandru Totolici -# http://hackd.net/projects/caseguard/ -# -# This Mercurial extension prevents users from adding: -# * filenames that differ only by case (i.e. 'FOO' and 'foo') -# * Windows-reserved filenames. -# -# Some filesystems cannot handle situations where files differ only by case. -# If such files are present (added from a filesystem that doesn't have this -# limitation) Mercurial will report a case-folding collision when the user -# tries to update. For more information, please see: -# http://mercurial.selenic.com/wiki/CaseFolding -# -# The operations that caseguard currently handles are 'add' and 'addremove'. -# -# To enable the "caseguard" extension globally, put these lines in your -# ~/.hgrc: -# [extensions] -# caseguard = /path/to/caseguard.py -# -# You may optionally add a section in the config file that specifies what -# options you want to have always enabled: -# -# [caseguard] -# override = true -# nowincheck = true -# -# You cannot enable -U/--unguard in the config file since this effectively -# disables the extension. -# -# Please note that having override always enabled will revert all commands -# to their normal behaviour. However, if you pass --verbose you will get a -# listing of the files that would cause problems. -# -# NOTE: renaming file1 to FILE1 and running addremove will NOT change what the -# repository tracks. All changes must be committed before caseguard will -# allow files to be added (this means 'hg rm foo; hg add FOO' will fail). -# -# -# This software may be used and distributed according to the terms of the -# GNU General Public License version 2 or any later version. - -'''guard against case-fold collisions and Windows name incompatibilities''' - -import re -from mercurial import commands, extensions, cmdutil, util -from mercurial.i18n import _ - -try: - from mercurial import scmutil - disablecaseguard = hasattr(scmutil, 'checkportable') -except ImportError: - disablecaseguard = False - -casewarn = _('case-collision danger') -namewarn = _('Windows-incompatible filenames detected') - -winbanpat = re.compile('((com[1-9](\..*)?)|(lpt[1-9](\..*)?)|(con(\..*)?)|' - '(aux(\..*)?)|''(prn(\..*)?)|(nul(\..*)?)|(clock\$))\Z', re.IGNORECASE) -badchars = ':*?"<>|' - -def _defaultloglevel(ui, abortonfail): - if abortonfail: - def doabort(msg): - raise util.Abort(msg) - return doabort - else: - def dowarn(msg): - ui.warn(_('warning: %s\n') % msg) - return dowarn - -def _wincheck(ui, f, loglevel=None, abortonfail=False): - if loglevel == None: - loglevel = _defaultloglevel(ui, abortonfail) - if winbanpat.match(f): - loglevel(_('filename contains \'%s\', which is reserved on Windows: \'%s\'') % (f, f)) - -def _charcheck(ui, f, loglevel=None, abortonfail=False): - if loglevel == None: - loglevel = _defaultloglevel(ui, abortonfail) - for c in f: - if c in badchars: - loglevel(_('filename contains \'%s\', which is reserved on Windows: \'%s\'') % (c, f)) - -def _casecollide(ui, repo, *pats, **opts): - '''check the case of the given file against the repository. Return True - on collisions and (optionally) print a list of problem-files.''' - override = opts['override'] or ui.configbool('caseguard', 'override') - nowinchk = opts['nowincheck'] or ui.configbool('caseguard', 'nowincheck') - - loglevel = _defaultloglevel(ui, not override) - - if len(set(s.lower() for s in pats)) != len(pats): - colliding = True - ui.note(_('file list contains a possible case-fold collision\n')) - - added = repo.status()[1] + repo.status()[3] - exclst = [item[0] for item in repo['.'].manifest().iteritems()] + added - chklst = [item.lower() for item in exclst] - mtch = dict(zip(chklst, exclst)) - m = cmdutil.match(repo, pats, opts) - - for f in repo.walk(m): - flwr = f.lower() - _wincheck(ui, f, loglevel) - _charcheck(ui, f, loglevel) - if f not in repo.dirstate and f not in exclst and flwr in mtch: - loglevel(_('possible case-folding collision for %s') % f) - mtch[flwr] = f - -def reallyadd(orig, ui, repo, *pats, **opts): - '''wrap the add command so it enforces that filenames differ in - more than just case - ''' - if disablecaseguard: - if opts['unguard']: - ui.setconfig('ui', 'portablefilenames', 'ignore') - elif opts['override']: - ui.setconfig('ui', 'portablefilenames', 'warn') - else: - ui.setconfig('ui', 'portablefilenames', 'abort') - if not opts['unguard'] and not disablecaseguard: - _casecollide(ui, repo, *pats, **opts) - return orig(ui, repo, *pats, **opts) - -def casecheck(ui, repo, *pats, **opts): - if not repo.local(): - ui.note(_('Only local repositories can be checked')) - return - '''check an existing local repository for filename issues (caseguard)''' - try: - # Mercurial >= 1.9 - m = scmutil.match(repo[0], pats, opts) - except ImportError: - # Mercurial <= 1.8 - m = cmdutil.match(repo, pats, opts) - - seen = dict() - - def dostatus(msg): - ui.status('%s\n' % msg) - - for f in repo.walk(m): - if f in repo.dirstate: - badname = _wincheck(ui, f, dostatus) or \ - _charcheck(ui, f, dostatus) - if f.lower() in seen: - dostatus(_('%s collides with %s') % (f, seen[f.lower()])) - else: - seen[f.lower()] = f - if not badname: - ui.note(_('\t[OK] %s\n') % f) - -wraplist = [extensions.wrapcommand(commands.table, 'add', reallyadd), - extensions.wrapcommand(commands.table, 'addremove', reallyadd)] - -# Mercurial 1.9 and later has case-checking built in when files are -# added, so only provide it in the extension for earlier versions. -for wrapcmd in wraplist: - if disablecaseguard: - wrapcmd[1].append(('o', 'override', False, _('ignored (present for compatibility' - ' with Mercurial 1.8 and earlier)'))) - wrapcmd[1].append(('w', 'nowincheck', False, _('ignored (present for compatibility' - ' with Mercurial 1.8 and earlier)'))) - else: - wrapcmd[1].append(('o', 'override', False, _('add files regardless of' - ' possible case-collision problems'))) - wrapcmd[1].append(('w', 'nowincheck', False, _('do not check' - ' filenames for Windows incompatibilities'))) - wrapcmd[1].append(('U', 'unguard', False, _('completely skip checks' - ' related to case-collision problems'))) - -cmdtable = { - 'casecheck': (casecheck, [], 'check the repository for filename issues')} +pass \ No newline at end of file
Change 1 of 1 Show Entire File gestalt.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
@@ -1,377 +1,1 @@
-# Copyright (C) 2009-2013 Fog Creek Software. All rights reserved. -# -# To enable the "gestalt" extension put these lines in your ~/.hgrc: -# [extensions] -# gestalt = /path/to/gestalt.py -# -# For help on the usage of "hg gestalt" use: -# hg help gestalt -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -'''provides a general overview of your repository state - -This extension attempts to help new Mercurial users by providing -several commands to help learn how Mercurial works. The primary -command provided is "hg next", which shows an overview of your -local repository, its relationship and status to its parent, -and what next actions you may wish to consider performing. -''' - -import re - -import mercurial.__version__ -from mercurial import bundlerepo, changegroup, cmdutil, commands, demandimport, hg, node, url, util -from mercurial.i18n import _ -from mercurial.error import RepoError - -## -# Compatibility shims - -# remoteui moved from cmdutil to hg in 1.6. -if hasattr(cmdutil, 'remoteui'): - remoteui = cmdutil.remoteui -else: - remoteui = hg.remoteui - -# findoutgoing and findcommonincoming moved from localrepo to -# discovery in 1.6. -demandimport.disable() -try: - from mercurial import localrepo - findcommonincoming = localrepo.localrepository.findcommonincoming - findoutgoing = localrepo.localrepository.findoutgoing -except AttributeError: - from mercurial import discovery - findcommonincoming = discovery.findcommonincoming - try: - # Mercurial <= 1.8 - findoutgoing = discovery.findoutgoing - except AttributeError: - # Mercurial >= 1.9 - def findoutgoing(repo, remote, force=False): - common, _anyinc, _heads = discovery.findcommonincoming(repo, remote, force=force) - return repo.changelog.findmissing(common) -demandimport.enable() - - -@apply -def _HG_VERSION(): - '''return the mercurial version as a tuple rather than a string - - Python does the right thing when comparing tuples, so the return - value can be used to compare and detect versions. - ''' - version = [0, 0, 0] - parts = [re.match(r'\d+', v).group(0) for v in mercurial.__version__.version.split('.')[:3]] - for i, part in enumerate(map(int, parts)): - version[i] = part - return tuple(version) - - -def parseurl(source): - '''wrap hg.parseurl to work on 1.5 and 1.6 - - 1.5 redefined parseurl()'s return values, and 1.6 split up the - branches parameter into a two-tuple. - ''' - uri, branches = hg.parseurl(source, None)[:2] - if _HG_VERSION >= (1, 6, 0): - # branches will be None because we passed None into - # parseuri(), so we can ignore that safely. - hashbranch, branches = branches - else: - # branches will contain one element or fewer because we passed - # None into parseuri(). - hashbranch = branches and branches[0] or None - return uri, hashbranch - - -def addbranchrevs(lrepo, repo, hashbranch): - '''wrap hg.addbranchrevs to work on 1.5 and 1.6 and returns the - first value (revs) only - - 1.5 added the call. 1.6 split up the revs parameter into a - two-tuple. - ''' - if _HG_VERSION < (1, 6, 0): - branches = hashbranch and [hashbranch] or [] - revs, checkout = hg.addbranchrevs(lrepo, repo, branches, None) - else: - branches = hashbranch, [] - revs, checkout = hg.addbranchrevs(lrepo, repo, branches, None) - return revs - - -## -# Private utility functions for determining advice output -def _isrepo(ui, repo, files, opts): - if not repo: - ui.status(_("""You need to create a Mercurial repository. - -Run -> hg init -""")) - return True - return False - - -def _ismerging(ui, repo, files, opts): - if repo.dirstate.parents()[1] != node.nullid: - ui.status(_('It appears there is a merge in progress.\n')) - return True - return False - - -def _haschanges(ui, repo, files, opts): - changed = any(repo.status()) - if changed: - ui.status(_('''You have changes in your working copy that should be committed -before updating your local or remote repositories: - -Run -> hg commit -''')) - return True - return False - - -def _shouldmerge(ui, repo, files, opts): - heads = repo.branchheads(closed=False) - if len(heads) > 1: - ui.status(_('''You have two heads in your local repository. To resolve this, -you should merge: - -Run -> hg merge -''')) - return True - return False - - -def _shouldsync(ui, repo, files, opts): - source, hashbranch = parseurl(ui.expandpath('default')) - - # grab incoming and outgoing changesets - try: - other = hg.repository(remoteui(repo, opts), source) - except RepoError: - ui.status(_('''You have not set a default repository in your configuration file. - -Edit your configuration file, .hg/hgrc, and add a default entry in -the [paths] section. -''')) - return True - revs = addbranchrevs(repo, other, hashbranch) - ui.pushbuffer() - common, incoming, rheads = findcommonincoming(repo, other, heads=revs, force=False) - ui.popbuffer() - - if incoming: - ui.status(_('''There are changes in your remote repository that haven't been -included in your local repository. To get your copy up-to-date you should: - -Run -> hg pull -''')) - return True - - source, hashbranch = parseurl(source) - other = hg.repository(remoteui(repo, opts), source) - revs = addbranchrevs(repo, other, hashbranch) - ui.pushbuffer() - outgoing = findoutgoing(repo, other, force=False) - if outgoing: - outgoing = repo.changelog.nodesbetween(outgoing, revs)[0] - ui.popbuffer() - - if outgoing: - ui.status(_('''You have changes in your local repository that aren't in your -remote repository. If you want to share your changes, you should: - -Run -> hg push -''')) - return True - return False - - -def _istip(ui, repo, files, opts): - tip = repo['tip'] - cwd = repo['.'] - if tip != cwd: - ui.status(_('''You are not at a head. You probably want to update to tip -before making any changes: - -Run -> hg up -''')) - return True - return False - - -def _shouldwritemorecode(ui, *ignored): - ui.status(_('Everything is up-to-date. Write more code!\n')) - return True - - -## -# General utility methods -def outgoing(repo, origin): - '''return a list of outgoing changesets''' - out = findoutgoing(repo, origin) - if out: - out = repo.changelog.nodesbetween(out, None)[0] - return out - - -def incoming(repo, origin, revs): - '''return a list of incoming changesets''' - if revs: - revs = [origin.lookup(rev) for rev in revs] - common, incoming, rheads = findcommonincoming(repo, origin, heads=revs, force=False) - if not incoming: - return [] - if not origin.local(): - # create a bundle (uncompressed if other repo is not local) - if not revs and origin.capable('changegroupsubset'): - revs = rheads - - if not revs: - cg = origin.changegroup(incoming, 'incoming') - else: - cg = origin.changegroupsubset(incoming, revs, 'incoming') - fname = changegroup.writebundle(cg, None, "HG10UN") - origin = bundlerepo.bundlerepository(repo.ui, repo.root, fname) - incoming = origin.changelog.findmissing(common, revs) - if hasattr(origin, 'close'): - origin.close() - return incoming - - -## -# commands -def overview(ui, repo, source=None, **opts): - '''provides a general overview of your repository state - - This command combines the output of the hg incomng, hg outgoing, - hg status, and hg id commands into an easily human-readable explanation - of the entire state of your current working repository. - ''' - if not repo: - return - originurl = ui.expandpath(source or 'default') - targeturl = ui.expandpath(source or 'default-push', source or 'default') - - origin, hashbranch = parseurl(originurl) - try: - origin = hg.repository(remoteui(repo, opts), origin) - except RepoError: - return - - target, hashbranch = parseurl(targeturl) - target = hg.repository(remoteui(repo, opts), target) - try: - # Mercurial >= 1.9 - hidepassword = util.hidepassword - except AttributeError: - # Mercurial <= 1.8 - hidepassword = url.hidepassword - if originurl == targeturl: - ui.status(_('parent repository: %s\n') % hidepassword(originurl)) - else: - ui.status(_('source repository: %s\n') % hidepassword(getattr(origin, 'root', origin.url()))) - ui.status(_('destination repository: %s\n') % hidepassword(getattr(target, 'root', target.url()))) - - ui.pushbuffer() - out = outgoing(repo, target) - inc = incoming(repo, origin, filter(bool, [hashbranch])) - ui.popbuffer() - - changed = any(repo.status()) - if changed: - status = _('uncommitted changes') - else: - status = _('working copy up-to-date') - - # grab heads - heads = repo.branchheads(None, closed=False) - if len(heads) > 1: - merge = 'merge required' - else: - merge = '' - - ui.status(_('| Remote | << %s | Local | %s\n') % (str(len(out)).center(5), merge)) - ui.status(_('| Repository | %s >> | Repository | %s\n') % (str(len(inc)).center(5), status)) - - if opts['detail']: - if len(out) > 0: - ui.status(_('\noutgoing changes:\n')) - for rev in out: - ui.status('%s %s\n' % (repo[rev], - repo[rev].description().strip().split('\n')[0])) - if len(inc) > 0: - ui.status(_('\nincoming changes:\n')) - for rev in inc: - ui.status('%s %s\n' % (repo[rev], - repo[rev].description().strip().split('\n')[0])) - if changed: - ui.status(_('\nlocal files:\n')) - ui.pushbuffer() - commands.status(ui, repo, '', **opts) - status = ui.popbuffer() - for l in status.splitlines(): - print ' %s' % l - - -def advice(ui, repo, *files, **opts): - '''provides a suggestion of your next step - - This command attempts to help new Mercurial users by suggesting - what your next step should be. These steps are suggestions only, - and do not provide an exhaustive list of all possible actions that - may be appropriate, but should nevertheless help you if you are - unsure how to proceed. - ''' - checks = [_isrepo, - _ismerging, - _haschanges, - _shouldmerge, - _shouldsync, - _istip, - _shouldwritemorecode] - for fun in checks: - if fun(ui, repo, files, opts): - return - - -def next(ui, repo, *files, **opts): - '''provides an overview and explanation of what to do next - - This command shows you a graphical representation of the - current state of your repository and its parent, and suggests - what your next step should be based on the picture.''' - overview(ui, repo, *files, **opts) - advice(ui, repo, *files, **opts) - - -cmdtable = { - 'overview': - (overview, - [('d', 'detail', None, _('provide verbose output'))], - _('hg gestalt [OPTION] [REMOTE REPOSITORY]')), - 'advice': - (advice, [], _('hg next')), - 'next|wtf': - (next, - [('d', 'detail', None, _('provide verbose output'))], - _('hg next [OPTION] [REMOTE REPOSITORY]')), -} - -commands.optionalrepo += 'wtf advice overview next' +pass \ No newline at end of file
Change 1 of 1 Show Entire File kilnfilecache.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,59 +0,0 @@
-# Copyright (C) 2011, 2012 Fog Creek Software. All rights reserved. -# -# This extension is used internally by Kiln Importer. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -'''fix a _filecache invalidation bug so hg convert works - -See - - * http://our.fogbugz.com/f/cases/2338914/importer-does-not-work-with-hg-2-3-1 and - * http://www.selenic.com/pipermail/mercurial-devel/2012-November/046159.html - - for more details. Until Mercurial fixes this bug or accepts my patch, -this bug affects any tags in this revset: - - * hg log -r 'descendants(9f94358) and tag()' --template '{tags}\n' - -As of writing, that's every 2.3 release and 2.4-rc and 2.4. -''' - -from mercurial import util - -def reposetup(ui, repo): - if util.version()[:3] < '2.3': - # This bug was first introduced in 9f94358f9f93, which - # occurred between 2.3-rc and 2.3. - return - - from mercurial import localrepo - if not issubclass(repo.__class__, localrepo.localrepository): - return - - class kilnfilecacherepo(repo.__class__): - def destroyed(self, *args, **kwargs): - # By saving _filecache before it's cleared, we can - # restore it and then call invalidate() afterward so - # localrepo can delattr() the relevant attributes off - # the repo object. See my mercurial-devel patch for - # more details. - oldfilecache = dict(self._filecache) - super(kilnfilecacherepo, self).destroyed(*args, **kwargs) - self._filecache = oldfilecache - self.invalidate() - - repo.__class__ = kilnfilecacherepo
Change 1 of 1 Show Entire File tests/​bfpath.py Stacked
 
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
@@ -1,10 +0,0 @@
-import sys -import os - -# Ensure that the bfiles extension directory is on the package search path -# so that modules in its tests directory can be found. -extpath = os.path.realpath(os.path.join(os.path.dirname(__file__), '../bfiles')) -try: - sys.path.index(extpath) -except ValueError: - sys.path.append(extpath)
Change 1 of 1 Show Entire File tests/​common.py Stacked
 
1
2
 
 
 
@@ -1,2 +0,0 @@
-import bfpath -from tests.common import *
Change 1 of 1 Show Entire File tests/​kilntest.py Stacked
 
1
2
 
 
 
@@ -1,2 +0,0 @@
-import bfpath -from tests.kilntest import *
Change 1 of 1 Show Entire File tests/​test-big-push.py.out Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,54 +0,0 @@
-% setup -hg add n1 -hg commit -m 'add file' -hg push -hg add n2 -hg commit -m 'add another file' -hg push --chunked -hg add n3 -hg commit -m 'changeset 3' -hg add n4 -hg commit -m 'changeset 4' -hg add n5 -hg commit -m 'changeset 5' -hg add n6 -hg commit -m 'changeset 6' -hg add n7 -hg commit -m 'changeset 7' -hg add n8 -hg commit -m 'changeset 8' -hg add n9 -hg commit -m 'changeset 9' -hg add n10 -hg commit -m 'changeset 10' -hg add n11 -hg commit -m 'changeset 11' -hg add n12 -hg commit -m 'changeset 12' -hg add n13 -hg commit -m 'changeset 13' -hg add n14 -hg commit -m 'changeset 14' -hg add n15 -hg commit -m 'changeset 15' -hg add n16 -hg commit -m 'changeset 16' -hg add n17 -hg commit -m 'changeset 17' -hg add n18 -hg commit -m 'changeset 18' -hg add n19 -hg commit -m 'changeset 19' -hg add n20 -hg commit -m 'changeset 20' -hg add n21 -hg commit -m 'changeset 21' -hg add n22 -hg commit -m 'changeset 22' -hg add n23 -hg commit -m 'changeset 23' -hg add n24 -hg commit -m 'changeset 24' -hg push --chunked -hg pull -hg push
Change 1 of 1 Show Entire File tests/​test-caseguard.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,54 +0,0 @@
-#!/usr/bin/env python -# -# Test caseguard extension - -import os -import common - -import hgtest -import kilntest - -hgt = common.BfilesTester() - -hgt.updaterc({'extensions': [('caseguard', kilntest.CASEGUARDPATH)]}) -hgt.announce('setup') -os.mkdir('repo1') -os.chdir('repo1') -hgt.hg(['init']) -hgt.writefile('abc', 'abc') -hgt.hg(['add', 'abc']) -hgt.hg(['casecheck']) -hgt.writefile('ABC', 'ABC') -hgt.hg(['add', 'ABC'], status=255, stderr='''abort: possible case-folding collision for ABC -''') -hgt.hg(['add', 'ABC', '-o'], stderr='''warning: possible case-folding collision for ABC -''') -hgt.writefile('com1', 'com1') -hgt.hg(['add', 'com1'], status=255, stderr='''abort: filename contains 'com1', which is reserved on Windows: 'com1' -''') -hgt.hg(['add', 'com1', '-o'], stderr='''warning: filename contains 'com1', which is reserved on Windows: 'com1' -''') -hgt.writefile('a<b', 'a<b') -hgt.hg(['add', 'a<b'], status=255, stderr='''abort: filename contains '<', which is reserved on Windows: 'a<b' -''') -hgt.hg(['add', 'a<b', '-o'], stderr='''warning: filename contains '<', which is reserved on Windows: 'a<b' -''') -hgt.writefile('Abc', 'Abc') -hgt.writefile('abC', 'abC') -hgt.hg(['add', '-o', 'Abc', 'abC'], stderr='''warning: possible case-folding collision for Abc -warning: possible case-folding collision for abC -''') -hgt.writefile('ABc', 'ABc') -hgt.hg(['add', '-U', 'ABc']) -hgt.writefile('aBC', 'aBC') -hgt.hg(['add', '-o', 'aBC'], stderr='''warning: possible case-folding collision for aBC -''') -hgt.hg(['casecheck'], '''ABc collides with ABC -Abc collides with ABC -filename contains '<', which is reserved on Windows: 'a<b' -aBC collides with ABC -abC collides with ABC -abc collides with ABC -filename contains 'com1', which is reserved on Windows: 'com1' -''') -os.chdir('..')
Change 1 of 1 Show Entire File tests/​test-caseguard.py.out Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,14 +0,0 @@
-% setup -hg init -hg add abc -hg casecheck -hg add ABC -hg add ABC -o -hg add com1 -hg add com1 -o -hg add 'a<b' -hg add 'a<b' -o -hg add -o Abc abC -hg add -U ABc -hg add -o aBC -hg casecheck
Change 1 of 1 Show Entire File tests/​test-gestalt.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,174 +0,0 @@
-#!/usr/bin/env python -# -# Test hg gestalt extension - -import os -import common - -import hgtest -import kilntest - -hgt = common.BfilesTester() - -hgt.updaterc({'extensions': [('kilnauth', kilntest.KILNAUTHPATH), - ('gestalt', kilntest.GESTALTPATH)]}) -hgt.announce('setup') -token = kilntest.gettoken() -kilntest.deletetest(hgt, token) -test = kilntest.createtest(hgt, token) -os.mkdir('repo1') -os.chdir('repo1') -hgt.hg(['next'], stdout='''You need to create a Mercurial repository. - -Run -> hg init -''') -hgt.hg(['init']) -hgt.hg(['next'], stdout='''You have not set a default repository in your configuration file. - -Edit your configuration file, .hg/hgrc, and add a default entry in -the [paths] section. -''') -hgt.writefile('.hg/hgrc', '''[paths] -default = %s/Repo/Test/Test/Test -''' % kilntest.KILNURL) -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -Everything is up-to-date. Write more code! -''' % kilntest.KILNURL) -hgt.writefile('n1', 'n1') -hgt.writefile('n2', 'n2') -hgt.hg(['add', 'n1', 'n2']) -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | uncommitted changes -You have changes in your working copy that should be committed -before updating your local or remote repositories: - -Run -> hg commit -''' % kilntest.KILNURL) -hgt.hg(['commit', '-m', 'add files']) -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 1 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -You have changes in your local repository that aren't in your -remote repository. If you want to share your changes, you should: - -Run -> hg push -''' % kilntest.KILNURL) -hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed one changeset -''' % kilntest.KILNURL) -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -Everything is up-to-date. Write more code! -''' % kilntest.KILNURL) -os.chdir('..') -hgt.hg(['clone', kilntest.KILNURL + '/Repo/Test/Test/Test', 'repo2'], log=False, - stdout='''requesting all changes -adding changesets -adding manifests -adding file changes -added 1 changesets with 2 changes to 2 files -updating to branch default -2 files updated, 0 files merged, 0 files removed, 0 files unresolved -''') -os.chdir('repo2') -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -Everything is up-to-date. Write more code! -''' % kilntest.KILNURL) -hgt.writefile('n3', 'n3') -hgt.writefile('n4', 'n4') -hgt.hg(['add', 'n3', 'n4']) -hgt.hg(['commit', '-m', 'add more files']) -hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed one changeset -''' % kilntest.KILNURL) -os.chdir('../repo1') -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 1 >> | Repository | working copy up-to-date -There are changes in your remote repository that haven't been -included in your local repository. To get your copy up-to-date you should: - -Run -> hg pull -''' % kilntest.KILNURL) -hgt.hg(['pull', '../repo2'], stdout='''pulling from ../repo2 -searching for changes -adding changesets -adding manifests -adding file changes -added 1 changesets with 2 changes to 2 files -(run 'hg update' to get a working copy) -''') -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -You are not at a head. You probably want to update to tip -before making any changes: - -Run -> hg up -''' % kilntest.KILNURL) -hgt.hg(['up'], stdout='''2 files updated, 0 files merged, 0 files removed, 0 files unresolved -''') -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -Everything is up-to-date. Write more code! -''' % kilntest.KILNURL) -hgt.writefile('n5', 'n5') -hgt.hg(['add', 'n5']) -hgt.hg(['commit', '-m', 'add file to repo1']) -hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed one changeset -''' % kilntest.KILNURL) -os.chdir('../repo2') -hgt.writefile('n6', 'n6') -hgt.hg(['add', 'n6']) -hgt.hg(['commit', '-m', 'add file to repo2']) -hgt.hg(['pull', '../repo1'], stdout='''pulling from ../repo1 -searching for changes -adding changesets -adding manifests -adding file changes -added 1 changesets with 1 changes to 1 files (+1 heads) -(run 'hg heads' to see heads, 'hg merge' to merge) -''') -hgt.hg(['next'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 1 | Local | merge required -| Repository | 0 >> | Repository | working copy up-to-date -You have two heads in your local repository. To resolve this, -you should merge: - -Run -> hg merge -''' % kilntest.KILNURL) -hgt.hg(['merge'], stdout='''1 files updated, 0 files merged, 0 files removed, 0 files unresolved -(branch merge, don't forget to commit) -''') -hgt.hg(['commit', '-m', 'merge']) -hgt.hg(['push'], stdout='''pushing to %s/Repo/Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed 2 changesets -''' % kilntest.KILNURL) -hgt.hg(['wtf'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -Everything is up-to-date. Write more code! -''' % kilntest.KILNURL) -hgt.hg(['overview'], stdout='''parent repository: %s/Repo/Test/Test/Test -| Remote | << 0 | Local | -| Repository | 0 >> | Repository | working copy up-to-date -''' % kilntest.KILNURL) -hgt.hg(['advice'], stdout='''Everything is up-to-date. Write more code! -''') -os.chdir('..')
Change 1 of 1 Show Entire File tests/​test-gestalt.py.out Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,33 +0,0 @@
-% setup -hg next -hg init -hg next -hg next -hg add n1 n2 -hg next -hg commit -m 'add files' -hg next -hg push -hg next -hg next -hg add n3 n4 -hg commit -m 'add more files' -hg push -hg next -hg pull ../repo2 -hg next -hg up -hg next -hg add n5 -hg commit -m 'add file to repo1' -hg push -hg add n6 -hg commit -m 'add file to repo2' -hg pull ../repo1 -hg next -hg merge -hg commit -m merge -hg push -hg wtf -hg overview -hg advice
Change 1 of 1 Show Entire File tests/​test-path.py Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,48 +0,0 @@
-#!/usr/bin/env python -# -# Test kilnpath extension - -import os -import common - -import hgtest -import kilntest - -hgt = common.BfilesTester() - -hgt.updaterc({'extensions': [('kilnauth', kilntest.KILNAUTHPATH), - ('kilnpath', kilntest.KILNPATHPATH)], - 'kiln_scheme': [('kiln', kilntest.KILNURL + '/Repo')]}) -hgt.announce('setup') -token = kilntest.gettoken() -kilntest.deletetest(hgt, token) -test = kilntest.createtest(hgt, token) -hgt.hg(['clone', 'kiln://Test/Test/Test', 'repo1'], - stdout='''no changes found -updating to branch default -0 files updated, 0 files merged, 0 files removed, 0 files unresolved -''') -os.chdir('repo1') -hgt.hg(['pull'], stdout='''pulling from kiln://Test/Test/Test -no changes found -''') -hgt.hg(['pull', 'kiln://Test/Test/Test'], stdout='''pulling from kiln://Test/Test/Test -no changes found -''') -hgt.writefile('n1', 'n1') -hgt.hg(['add', 'n1']) -hgt.hg(['commit', '-m', 'add file']) -hgt.hg(['push'], stdout='''pushing to kiln://Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed one changeset -''') -hgt.writefile('n2', 'n2') -hgt.hg(['add', 'n2']) -hgt.hg(['commit', '-m', 'add another file']) -hgt.hg(['push', 'kiln://Test/Test/Test'], stdout='''pushing to kiln://Test/Test/Test -searching for changes -searching for changes -remote: kiln: successfully pushed one changeset -''') -os.chdir('..')
Change 1 of 1 Show Entire File tests/​test-path.py.out Stacked
 
1
2
3
4
5
6
7
8
9
10
 
 
 
 
 
 
 
 
 
 
 
@@ -1,10 +0,0 @@
-% setup -hg clone kiln://Test/Test/Test repo1 -hg pull -hg pull kiln://Test/Test/Test -hg add n1 -hg commit -m 'add file' -hg push -hg add n2 -hg commit -m 'add another file' -hg push kiln://Test/Test/Test
Change 1 of 1 Show Entire File tests/​test-targets.py.out Stacked
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,15 +0,0 @@
-% setup -hg add n1 -hg commit -m 'add file' -hg push -hg kiln -t -hg add n2 -hg commit -m 'add to central repository' -hg push Test -hg push -hg add n3 -hg commit -m 'add to branch repository' -hg outgoing TestBranch -hg push TestBranch -hg incoming TestBranch -hg pull TestBranch