##// END OF EJS Templates
merge with stable
Matt Mackall -
r26860:f9984f76 merge default
parent child Browse files
Show More
@@ -211,18 +211,6 b' def capabilities(orig, repo, proto):'
211
211
212 return caps
212 return caps
213
213
214 @wireproto.wireprotocommand('clonebundles', '')
215 def bundles(repo, proto):
216 """Server command for returning info for available bundles to seed clones.
217
218 Clients will parse this response and determine what bundle to fetch.
219
220 Other extensions may wrap this command to filter or dynamically emit
221 data depending on the request. e.g. you could advertise URLs for
222 the closest data center given the client's IP address.
223 """
224 return repo.opener.tryread('clonebundles.manifest')
225
226 @exchange.getbundle2partsgenerator('clonebundlesadvertise', 0)
214 @exchange.getbundle2partsgenerator('clonebundlesadvertise', 0)
227 def advertiseclonebundlespart(bundler, repo, source, bundlecaps=None,
215 def advertiseclonebundlespart(bundler, repo, source, bundlecaps=None,
228 b2caps=None, heads=None, common=None,
216 b2caps=None, heads=None, common=None,
@@ -71,9 +71,7 b' def promptchoice(pe):'
71 deprecatedpe = None
71 deprecatedpe = None
72 @scanner()
72 @scanner()
73 def deprecatedsetup(pofile):
73 def deprecatedsetup(pofile):
74 pes = [p for p in pofile
74 pes = [p for p in pofile if p.msgid == '(DEPRECATED)' and p.msgstr]
75 if ((p.msgid == 'DEPRECATED' or p.msgid == '(DEPRECATED)') and
76 p.msgstr)]
77 if len(pes):
75 if len(pes):
78 global deprecatedpe
76 global deprecatedpe
79 deprecatedpe = pes[0]
77 deprecatedpe = pes[0]
@@ -82,8 +80,8 b' def deprecatedsetup(pofile):'
82 def deprecated(pe):
80 def deprecated(pe):
83 """Check for DEPRECATED
81 """Check for DEPRECATED
84 >>> ped = polib.POEntry(
82 >>> ped = polib.POEntry(
85 ... msgid = 'DEPRECATED',
83 ... msgid = '(DEPRECATED)',
86 ... msgstr= 'DETACERPED')
84 ... msgstr= '(DETACERPED)')
87 >>> deprecatedsetup([ped])
85 >>> deprecatedsetup([ped])
88 >>> pe = polib.POEntry(
86 >>> pe = polib.POEntry(
89 ... msgid = 'Something (DEPRECATED)',
87 ... msgid = 'Something (DEPRECATED)',
@@ -9366,8 +9366,8 b' msgstr ""'
9366 msgid "VALUE"
9366 msgid "VALUE"
9367 msgstr ""
9367 msgstr ""
9368
9368
9369 msgid "DEPRECATED"
9369 msgid "(DEPRECATED)"
9370 msgstr "FORÆLDET"
9370 msgstr "(FORÆLDET)"
9371
9371
9372 msgid ""
9372 msgid ""
9373 "\n"
9373 "\n"
@@ -7505,8 +7505,8 b' msgstr "estensioni abilitate:"'
7505 msgid "VALUE"
7505 msgid "VALUE"
7506 msgstr ""
7506 msgstr ""
7507
7507
7508 msgid "DEPRECATED"
7508 msgid "(DEPRECATED)"
7509 msgstr "DEPRECATO"
7509 msgstr "(DEPRECATO)"
7510
7510
7511 msgid ""
7511 msgid ""
7512 "\n"
7512 "\n"
@@ -8258,8 +8258,8 b' msgstr "extensii activate:"'
8258 msgid "VALUE"
8258 msgid "VALUE"
8259 msgstr "VALOARE"
8259 msgstr "VALOARE"
8260
8260
8261 msgid "DEPRECATED"
8261 msgid "(DEPRECATED)"
8262 msgstr "ÎNVECHIT"
8262 msgstr "(ÎNVECHIT)"
8263
8263
8264 msgid ""
8264 msgid ""
8265 "\n"
8265 "\n"
@@ -10444,5 +10444,5 b' msgstr ""'
10444 msgid "user name not available - set USERNAME environment variable"
10444 msgid "user name not available - set USERNAME environment variable"
10445 msgstr ""
10445 msgstr ""
10446
10446
10447 msgid "DEPRECATED"
10447 msgid "(DEPRECATED)"
10448 msgstr "不衞成"
10448 msgstr "(不衞成)"
@@ -406,6 +406,10 b' class cg1unpacker(object):'
406 % (changesets, revisions, files, htext))
406 % (changesets, revisions, files, htext))
407 repo.invalidatevolatilesets()
407 repo.invalidatevolatilesets()
408
408
409 # Call delayupdate again to ensure the transaction writepending
410 # subscriptions are still in place.
411 cl.delayupdate(tr)
412
409 if changesets > 0:
413 if changesets > 0:
410 if 'node' not in tr.hookargs:
414 if 'node' not in tr.hookargs:
411 tr.hookargs['node'] = hex(cl.node(clstart))
415 tr.hookargs['node'] = hex(cl.node(clstart))
@@ -1658,6 +1658,10 b' def _maybeapplyclonebundle(pullop):'
1658 if not repo.ui.configbool('experimental', 'clonebundles', False):
1658 if not repo.ui.configbool('experimental', 'clonebundles', False):
1659 return
1659 return
1660
1660
1661 # Only run if local repo is empty.
1662 if len(repo):
1663 return
1664
1661 if pullop.heads:
1665 if pullop.heads:
1662 return
1666 return
1663
1667
@@ -122,7 +122,8 b' def _exthook(ui, repo, name, cmd, args, '
122 # make in-memory changes visible to external process
122 # make in-memory changes visible to external process
123 tr = repo.currenttransaction()
123 tr = repo.currenttransaction()
124 repo.dirstate.write(tr)
124 repo.dirstate.write(tr)
125 if tr and tr.writepending():
125 if tr:
126 tr.writepending()
126 env['HG_PENDING'] = repo.root
127 env['HG_PENDING'] = repo.root
127
128
128 for k, v in args.iteritems():
129 for k, v in args.iteritems():
@@ -197,7 +197,11 b' def json(obj):'
197 return {None: 'null', False: 'false', True: 'true'}[obj]
197 return {None: 'null', False: 'false', True: 'true'}[obj]
198 elif isinstance(obj, int) or isinstance(obj, float):
198 elif isinstance(obj, int) or isinstance(obj, float):
199 return str(obj)
199 return str(obj)
200 elif isinstance(obj, encoding.localstr):
201 u = encoding.fromlocal(obj).decode('utf-8') # can round-trip
202 return '"%s"' % jsonescape(u)
200 elif isinstance(obj, str):
203 elif isinstance(obj, str):
204 # no encoding.fromlocal() because it may abort if obj can't be decoded
201 u = unicode(obj, encoding.encoding, 'replace')
205 u = unicode(obj, encoding.encoding, 'replace')
202 return '"%s"' % jsonescape(u)
206 return '"%s"' % jsonescape(u)
203 elif isinstance(obj, unicode):
207 elif isinstance(obj, unicode):
@@ -549,6 +549,17 b' def branches(repo, proto, nodes):'
549 r.append(encodelist(b) + "\n")
549 r.append(encodelist(b) + "\n")
550 return "".join(r)
550 return "".join(r)
551
551
552 @wireprotocommand('clonebundles', '')
553 def clonebundles(repo, proto):
554 """Server command for returning info for available bundles to seed clones.
555
556 Clients will parse this response and determine what bundle to fetch.
557
558 Extensions may wrap this command to filter or dynamically emit data
559 depending on the request. e.g. you could advertise URLs for the closest
560 data center given the client's IP address.
561 """
562 return repo.opener.tryread('clonebundles.manifest')
552
563
553 wireprotocaps = ['lookup', 'changegroupsubset', 'branchmap', 'pushkey',
564 wireprotocaps = ['lookup', 'changegroupsubset', 'branchmap', 'pushkey',
554 'known', 'getbundle', 'unbundlehash', 'batch']
565 'known', 'getbundle', 'unbundlehash', 'batch']
@@ -156,6 +156,25 b' changes. If this output changes, we coul'
156 adding file changes
156 adding file changes
157 added 1 changesets with 1 changes to 1 files
157 added 1 changesets with 1 changes to 1 files
158
158
159 Incremental pull doesn't fetch bundle
160
161 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
162 adding changesets
163 adding manifests
164 adding file changes
165 added 1 changesets with 1 changes to 1 files
166
167 $ cd partial-clone
168 $ hg pull
169 pulling from http://localhost:$HGPORT/
170 searching for changes
171 adding changesets
172 adding manifests
173 adding file changes
174 added 1 changesets with 1 changes to 1 files
175 (run 'hg update' to get a working copy)
176 $ cd ..
177
159 Bundle with full content works
178 Bundle with full content works
160
179
161 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
180 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
@@ -205,6 +224,18 b' by old clients.'
205 searching for changes
224 searching for changes
206 no changes found
225 no changes found
207
226
227 Feature works over SSH
228
229 $ hg clone -U -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/server ssh-full-clone
230 applying clone bundle from http://localhost:$HGPORT1/full.hg
231 adding changesets
232 adding manifests
233 adding file changes
234 added 2 changesets with 2 changes to 2 files
235 finished applying clone bundle
236 searching for changes
237 no changes found
238
208 Entry with unknown BUNDLESPEC is filtered and not used
239 Entry with unknown BUNDLESPEC is filtered and not used
209
240
210 $ cat > server/.hg/clonebundles.manifest << EOF
241 $ cat > server/.hg/clonebundles.manifest << EOF
@@ -3479,3 +3479,26 b' Test broken string escapes:'
3479 $ hg log -T "\\xy" -R a
3479 $ hg log -T "\\xy" -R a
3480 hg: parse error: invalid \x escape
3480 hg: parse error: invalid \x escape
3481 [255]
3481 [255]
3482
3483 Set up repository for non-ascii encoding tests:
3484
3485 $ hg init nonascii
3486 $ cd nonascii
3487 $ python <<EOF
3488 > open('utf-8', 'w').write('\xc3\xa9')
3489 > EOF
3490 $ HGENCODING=utf-8 hg branch -q `cat utf-8`
3491 $ HGENCODING=utf-8 hg ci -qAm 'non-ascii branch' utf-8
3492
3493 json filter should try round-trip conversion to utf-8:
3494
3495 $ HGENCODING=ascii hg log -T "{branch|json}\n" -r0
3496 "\u00e9"
3497
3498 json filter should not abort if it can't decode bytes:
3499 (not sure the current behavior is right; we might want to use utf-8b encoding?)
3500
3501 $ HGENCODING=ascii hg log -T "{'`cat utf-8`'|json}\n" -l1
3502 "\ufffd\ufffd"
3503
3504 $ cd ..
@@ -113,7 +113,7 b' test generic hooks'
113 $ hg pull ../a
113 $ hg pull ../a
114 pulling from ../a
114 pulling from ../a
115 searching for changes
115 searching for changes
116 prechangegroup hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
116 prechangegroup hook: HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
117 adding changesets
117 adding changesets
118 adding manifests
118 adding manifests
119 adding file changes
119 adding file changes
@@ -272,7 +272,7 b' test that prepushkey can prevent incomin'
272 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
272 listkeys hook: HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
273 no changes found
273 no changes found
274 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=push (glob)
274 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=push (glob)
275 prepushkey.forbid hook: HG_BUNDLE2=1 HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
275 prepushkey.forbid hook: HG_BUNDLE2=1 HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:* HG_URL=push (glob)
276 pushkey-abort: prepushkey hook exited with status 1
276 pushkey-abort: prepushkey hook exited with status 1
277 abort: exporting bookmark baz failed!
277 abort: exporting bookmark baz failed!
278 [255]
278 [255]
@@ -306,7 +306,7 b' prechangegroup hook can prevent incoming'
306 $ hg pull ../a
306 $ hg pull ../a
307 pulling from ../a
307 pulling from ../a
308 searching for changes
308 searching for changes
309 prechangegroup.forbid hook: HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
309 prechangegroup.forbid hook: HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:* HG_URL=file:$TESTTMP/a (glob)
310 abort: prechangegroup.forbid hook exited with status 1
310 abort: prechangegroup.forbid hook exited with status 1
311 [255]
311 [255]
312
312
@@ -686,6 +686,7 b' new commits must be visible in pretxncha'
686 $ cd ..
686 $ cd ..
687 $ hg init to
687 $ hg init to
688 $ echo '[hooks]' >> to/.hg/hgrc
688 $ echo '[hooks]' >> to/.hg/hgrc
689 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
689 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
690 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
690 $ echo a >> to/a
691 $ echo a >> to/a
691 $ hg --cwd to ci -Ama
692 $ hg --cwd to ci -Ama
@@ -698,6 +699,12 b' new commits must be visible in pretxncha'
698 $ hg --cwd from push
699 $ hg --cwd from push
699 pushing to $TESTTMP/to (glob)
700 pushing to $TESTTMP/to (glob)
700 searching for changes
701 searching for changes
702 changeset: 0:cb9a9f314b8b
703 tag: tip
704 user: test
705 date: Thu Jan 01 00:00:00 1970 +0000
706 summary: a
707
701 adding changesets
708 adding changesets
702 adding manifests
709 adding manifests
703 adding file changes
710 adding file changes
General Comments 0
You need to be logged in to leave comments. Login now