Mercurial > hg
comparison mercurial/commands.py @ 13366:c756e9166417
bookmarks: merge incoming/outgoing into core
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 10 Feb 2011 13:46:28 -0600 |
parents | 6367459decf7 |
children | cef73cd9c268 |
comparison
equal
deleted
inserted
replaced
13365:f1c5294e9119 | 13366:c756e9166417 |
---|---|
7 | 7 |
8 from node import hex, nullid, nullrev, short | 8 from node import hex, nullid, nullrev, short |
9 from lock import release | 9 from lock import release |
10 from i18n import _, gettext | 10 from i18n import _, gettext |
11 import os, re, sys, difflib, time, tempfile | 11 import os, re, sys, difflib, time, tempfile |
12 import hg, util, revlog, extensions, copies, error | 12 import hg, util, revlog, extensions, copies, error, bookmarks |
13 import patch, help, mdiff, url, encoding, templatekw, discovery | 13 import patch, help, mdiff, url, encoding, templatekw, discovery |
14 import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server | 14 import archival, changegroup, cmdutil, sshserver, hbisect, hgweb, hgweb.server |
15 import merge as mergemod | 15 import merge as mergemod |
16 import minirst, revset | 16 import minirst, revset |
17 import dagparser | 17 import dagparser |
2397 Returns 0 if there are incoming changes, 1 otherwise. | 2397 Returns 0 if there are incoming changes, 1 otherwise. |
2398 """ | 2398 """ |
2399 if opts.get('bundle') and opts.get('subrepos'): | 2399 if opts.get('bundle') and opts.get('subrepos'): |
2400 raise util.Abort(_('cannot combine --bundle and --subrepos')) | 2400 raise util.Abort(_('cannot combine --bundle and --subrepos')) |
2401 | 2401 |
2402 if opts.get('bookmarks'): | |
2403 source, branches = hg.parseurl(ui.expandpath(source), | |
2404 opts.get('branch')) | |
2405 other = hg.repository(hg.remoteui(repo, opts), source) | |
2406 ui.status(_('comparing with %s\n') % url.hidepassword(source)) | |
2407 return bookmarks.diff(ui, repo, other) | |
2408 | |
2402 ret = hg.incoming(ui, repo, source, opts) | 2409 ret = hg.incoming(ui, repo, source, opts) |
2403 return ret | 2410 return ret |
2404 | 2411 |
2405 def init(ui, dest=".", **opts): | 2412 def init(ui, dest=".", **opts): |
2406 """create a new repository in the given directory | 2413 """create a new repository in the given directory |
2673 | 2680 |
2674 See pull for details of valid destination formats. | 2681 See pull for details of valid destination formats. |
2675 | 2682 |
2676 Returns 0 if there are outgoing changes, 1 otherwise. | 2683 Returns 0 if there are outgoing changes, 1 otherwise. |
2677 """ | 2684 """ |
2685 | |
2686 if opts.get('bookmarks'): | |
2687 dest = ui.expandpath(dest or 'default-push', dest or 'default') | |
2688 dest, branches = hg.parseurl(dest, opts.get('branch')) | |
2689 other = hg.repository(hg.remoteui(repo, opts), dest) | |
2690 ui.status(_('comparing with %s\n') % url.hidepassword(dest)) | |
2691 return bookmarks.diff(ui, other, repo) | |
2692 | |
2678 ret = hg.outgoing(ui, repo, dest, opts) | 2693 ret = hg.outgoing(ui, repo, dest, opts) |
2679 return ret | 2694 return ret |
2680 | 2695 |
2681 def parents(ui, repo, file_=None, **opts): | 2696 def parents(ui, repo, file_=None, **opts): |
2682 """show the parents of the working directory or revision | 2697 """show the parents of the working directory or revision |
4285 ('n', 'newest-first', None, _('show newest record first')), | 4300 ('n', 'newest-first', None, _('show newest record first')), |
4286 ('', 'bundle', '', | 4301 ('', 'bundle', '', |
4287 _('file to store the bundles into'), _('FILE')), | 4302 _('file to store the bundles into'), _('FILE')), |
4288 ('r', 'rev', [], | 4303 ('r', 'rev', [], |
4289 _('a remote changeset intended to be added'), _('REV')), | 4304 _('a remote changeset intended to be added'), _('REV')), |
4305 ('B', 'bookmarks', False, _("compare bookmarks")), | |
4290 ('b', 'branch', [], | 4306 ('b', 'branch', [], |
4291 _('a specific branch you would like to pull'), _('BRANCH')), | 4307 _('a specific branch you would like to pull'), _('BRANCH')), |
4292 ] + logopts + remoteopts + subrepoopts, | 4308 ] + logopts + remoteopts + subrepoopts, |
4293 _('[-p] [-n] [-M] [-f] [-r REV]...' | 4309 _('[-p] [-n] [-M] [-f] [-r REV]...' |
4294 ' [--bundle FILENAME] [SOURCE]')), | 4310 ' [--bundle FILENAME] [SOURCE]')), |
4353 _('run even when the destination is unrelated')), | 4369 _('run even when the destination is unrelated')), |
4354 ('r', 'rev', [], | 4370 ('r', 'rev', [], |
4355 _('a changeset intended to be included in the destination'), | 4371 _('a changeset intended to be included in the destination'), |
4356 _('REV')), | 4372 _('REV')), |
4357 ('n', 'newest-first', None, _('show newest record first')), | 4373 ('n', 'newest-first', None, _('show newest record first')), |
4374 ('B', 'bookmarks', False, _("compare bookmarks")), | |
4358 ('b', 'branch', [], | 4375 ('b', 'branch', [], |
4359 _('a specific branch you would like to push'), _('BRANCH')), | 4376 _('a specific branch you would like to push'), _('BRANCH')), |
4360 ] + logopts + remoteopts + subrepoopts, | 4377 ] + logopts + remoteopts + subrepoopts, |
4361 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')), | 4378 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')), |
4362 "parents": | 4379 "parents": |