##// END OF EJS Templates
incoming: recurse into subrepositories with --subrepos/-S flag...
Martin Geisler -
r12274:c02e1ed3 default
parent child Browse files
Show More
@@ -2357,7 +2357,16 b' def incoming(ui, repo, source="default",'
2357 2357
2358 2358 Returns 0 if there are incoming changes, 1 otherwise.
2359 2359 """
2360 return hg.incoming(ui, repo, source, opts)
2360 if opts.get('bundle') and opts.get('subrepos'):
2361 raise util.Abort(_('cannot combine --bundle and --subrepos'))
2362
2363 ret = hg.incoming(ui, repo, source, opts)
2364 if opts.get('subrepos'):
2365 ctx = repo[None]
2366 for subpath in sorted(ctx.substate):
2367 sub = ctx.sub(subpath)
2368 ret = min(ret, sub.incoming(ui, source, opts))
2369 return ret
2361 2370
2362 2371 def init(ui, dest=".", **opts):
2363 2372 """create a new repository in the given directory
@@ -4191,7 +4200,7 b' table = {'
4191 4200 _('a remote changeset intended to be added'), _('REV')),
4192 4201 ('b', 'branch', [],
4193 4202 _('a specific branch you would like to pull'), _('BRANCH')),
4194 ] + logopts + remoteopts,
4203 ] + logopts + remoteopts + subrepoopts,
4195 4204 _('[-p] [-n] [-M] [-f] [-r REV]...'
4196 4205 ' [--bundle FILENAME] [SOURCE]')),
4197 4206 "^init":
@@ -267,6 +267,9 b' class abstractsubrepo(object):'
267 267 def outgoing(self, ui, dest, opts):
268 268 return 1
269 269
270 def incoming(self, ui, source, opts):
271 return 1
272
270 273 class hgsubrepo(abstractsubrepo):
271 274 def __init__(self, ctx, path, state):
272 275 self._path = path
@@ -400,6 +403,9 b' class hgsubrepo(abstractsubrepo):'
400 403 def outgoing(self, ui, dest, opts):
401 404 return hg.outgoing(ui, self._repo, _abssource(self._repo, True), opts)
402 405
406 def incoming(self, ui, source, opts):
407 return hg.incoming(ui, self._repo, _abssource(self._repo, False), opts)
408
403 409 class svnsubrepo(abstractsubrepo):
404 410 def __init__(self, ctx, path, state):
405 411 self._path = path
@@ -227,7 +227,7 b' Show all commands + options'
227 227 help:
228 228 identify: rev, num, id, branch, tags
229 229 import: strip, base, force, no-commit, exact, import-branch, message, logfile, date, user, similarity
230 incoming: force, newest-first, bundle, rev, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd
230 incoming: force, newest-first, bundle, rev, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, subrepos
231 231 locate: rev, print0, fullpath, include, exclude
232 232 manifest: rev
233 233 outgoing: force, rev, newest-first, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, subrepos
@@ -287,3 +287,33 b' Make nested change:'
287 287 date: Thu Jan 01 00:00:00 1970 +0000
288 288 summary: 3-4-2
289 289
290
291 Switch to original repo and setup default path:
292
293 $ cd ../repo
294 $ echo '[paths]' >> .hg/hgrc
295 $ echo 'default = ../repo2' >> .hg/hgrc
296
297 Test incoming:
298
299 $ hg incoming -S
300 comparing with .*/test-subrepo-recursion.t/repo2
301 searching for changes
302 changeset: 3:2655b8ecc4ee
303 tag: tip
304 user: test
305 date: Thu Jan 01 00:00:00 1970 +0000
306 summary: 3-4-2
307
308 comparing with .*/test-subrepo-recursion.t/repo2/foo
309 searching for changes
310 changeset: 4:e96193d6cb36
311 tag: tip
312 user: test
313 date: Thu Jan 01 00:00:00 1970 +0000
314 summary: 3-4-2
315
316 $ hg incoming -S --bundle incoming.hg
317 abort: cannot combine --bundle and --subrepos
318
319 $ exit 0
General Comments 0
You need to be logged in to leave comments. Login now