mercurial/commands.py
changeset 11644 c4f6f0a1bd5a
parent 11630 0c23085f051f
parent 11636 c10eaf1210cd
child 11686 fc360de66217
equal deleted inserted replaced
11635:4da35e02b67c 11644:c4f6f0a1bd5a
   547     permissions, copy/rename information, and revision history.
   547     permissions, copy/rename information, and revision history.
   548 
   548 
   549     Returns 0 on success, 1 if no changes found.
   549     Returns 0 on success, 1 if no changes found.
   550     """
   550     """
   551     revs = opts.get('rev') or None
   551     revs = opts.get('rev') or None
   552     if revs:
       
   553         revs = [repo.lookup(rev) for rev in revs]
       
   554     if opts.get('all'):
   552     if opts.get('all'):
   555         base = ['null']
   553         base = ['null']
   556     else:
   554     else:
   557         base = opts.get('base')
   555         base = opts.get('base')
   558     if base:
   556     if base:
   565         o = []
   563         o = []
   566         has = set((nullid,))
   564         has = set((nullid,))
   567         for n in base:
   565         for n in base:
   568             has.update(repo.changelog.reachable(n))
   566             has.update(repo.changelog.reachable(n))
   569         if revs:
   567         if revs:
   570             visit = list(revs)
   568             revs = [repo.lookup(rev) for rev in revs]
   571             has.difference_update(revs)
   569             visit = revs[:]
       
   570             has.difference_update(visit)
   572         else:
   571         else:
   573             visit = repo.changelog.heads()
   572             visit = repo.changelog.heads()
   574         seen = {}
   573         seen = {}
   575         while visit:
   574         while visit:
   576             n = visit.pop(0)
   575             n = visit.pop(0)
   586     else:
   585     else:
   587         dest = ui.expandpath(dest or 'default-push', dest or 'default')
   586         dest = ui.expandpath(dest or 'default-push', dest or 'default')
   588         dest, branches = hg.parseurl(dest, opts.get('branch'))
   587         dest, branches = hg.parseurl(dest, opts.get('branch'))
   589         other = hg.repository(hg.remoteui(repo, opts), dest)
   588         other = hg.repository(hg.remoteui(repo, opts), dest)
   590         revs, checkout = hg.addbranchrevs(repo, other, branches, revs)
   589         revs, checkout = hg.addbranchrevs(repo, other, branches, revs)
       
   590         if revs:
       
   591             revs = [repo.lookup(rev) for rev in revs]
   591         o = discovery.findoutgoing(repo, other, force=opts.get('force'))
   592         o = discovery.findoutgoing(repo, other, force=opts.get('force'))
   592 
   593 
   593     if not o:
   594     if not o:
   594         ui.status(_("no changes found\n"))
   595         ui.status(_("no changes found\n"))
   595         return 1
   596         return 1