mercurial/commands.py
changeset 3503 b28d3e0f9a8c
parent 3502 8dc14d630b29
child 3504 f4ab58d4ccd4
equal deleted inserted replaced
3502:8dc14d630b29 3503:b28d3e0f9a8c
  1586         heads = repo.heads(repo.lookup(opts['rev']))
  1586         heads = repo.heads(repo.lookup(opts['rev']))
  1587     else:
  1587     else:
  1588         heads = repo.heads()
  1588         heads = repo.heads()
  1589     br = None
  1589     br = None
  1590     if opts['branches']:
  1590     if opts['branches']:
       
  1591         ui.warn(_("the --branches option is deprecated, "
       
  1592                   "please use 'hg branches' instead\n"))
  1591         br = repo.branchlookup(heads)
  1593         br = repo.branchlookup(heads)
  1592     displayer = show_changeset(ui, repo, opts)
  1594     displayer = show_changeset(ui, repo, opts)
  1593     for n in heads:
  1595     for n in heads:
  1594         displayer.show(changenode=n, brinfo=br)
  1596         displayer.show(changenode=n, brinfo=br)
  1595 
  1597 
  1925                 if miss:
  1927                 if miss:
  1926                     continue
  1928                     continue
  1927 
  1929 
  1928             br = None
  1930             br = None
  1929             if opts['branches']:
  1931             if opts['branches']:
       
  1932                 ui.warn(_("the --branches option is deprecated, "
       
  1933                           "please use 'hg branches' instead\n"))
  1930                 br = repo.branchlookup([repo.changelog.node(rev)])
  1934                 br = repo.branchlookup([repo.changelog.node(rev)])
  1931 
  1935 
  1932             copies = []
  1936             copies = []
  1933             if opts.get('copies') and rev:
  1937             if opts.get('copies') and rev:
  1934                 mf = getchange(rev)[0]
  1938                 mf = getchange(rev)[0]
  2068     else:
  2072     else:
  2069         p = repo.dirstate.parents()
  2073         p = repo.dirstate.parents()
  2070 
  2074 
  2071     br = None
  2075     br = None
  2072     if branches is not None:
  2076     if branches is not None:
       
  2077         ui.warn(_("the --branches option is deprecated, "
       
  2078                   "please use 'hg branches' instead\n"))
  2073         br = repo.branchlookup(p)
  2079         br = repo.branchlookup(p)
  2074     displayer = show_changeset(ui, repo, opts)
  2080     displayer = show_changeset(ui, repo, opts)
  2075     for n in p:
  2081     for n in p:
  2076         if n != nullid:
  2082         if n != nullid:
  2077             displayer.show(changenode=n, brinfo=br)
  2083             displayer.show(changenode=n, brinfo=br)
  2695     Show the tip revision.
  2701     Show the tip revision.
  2696     """
  2702     """
  2697     n = repo.changelog.tip()
  2703     n = repo.changelog.tip()
  2698     br = None
  2704     br = None
  2699     if opts['branches']:
  2705     if opts['branches']:
       
  2706         ui.warn(_("the --branches option is deprecated, "
       
  2707                   "please use 'hg branches' instead\n"))
  2700         br = repo.branchlookup([n])
  2708         br = repo.branchlookup([n])
  2701     show_changeset(ui, repo, opts).show(changenode=n, brinfo=br)
  2709     show_changeset(ui, repo, opts).show(changenode=n, brinfo=br)
  2702     if opts['patch']:
  2710     if opts['patch']:
  2703         patch.diff(repo, repo.changelog.parents(n)[0], n)
  2711         patch.diff(repo, repo.changelog.parents(n)[0], n)
  2704 
  2712 
  2770     else:
  2778     else:
  2771         return hg.update(repo, node)
  2779         return hg.update(repo, node)
  2772 
  2780 
  2773 def _lookup(repo, node, branch=None):
  2781 def _lookup(repo, node, branch=None):
  2774     if branch:
  2782     if branch:
       
  2783         repo.ui.warn(_("the --branch option is deprecated, "
       
  2784                        "please use 'hg branch' instead\n"))
  2775         br = repo.branchlookup(branch=branch)
  2785         br = repo.branchlookup(branch=branch)
  2776         found = []
  2786         found = []
  2777         for x in br:
  2787         for x in br:
  2778             if branch in br[x]:
  2788             if branch in br[x]:
  2779                 found.append(x)
  2789                 found.append(x)
  2982           ('u', 'user', None, _('print user who committed change')),
  2992           ('u', 'user', None, _('print user who committed change')),
  2983          ] + walkopts,
  2993          ] + walkopts,
  2984          _('hg grep [OPTION]... PATTERN [FILE]...')),
  2994          _('hg grep [OPTION]... PATTERN [FILE]...')),
  2985     "heads":
  2995     "heads":
  2986         (heads,
  2996         (heads,
  2987          [('b', 'branches', None, _('show branches')),
  2997          [('b', 'branches', None, _('show branches (DEPRECATED)')),
  2988           ('', 'style', '', _('display using template map file')),
  2998           ('', 'style', '', _('display using template map file')),
  2989           ('r', 'rev', '', _('show only heads which are descendants of rev')),
  2999           ('r', 'rev', '', _('show only heads which are descendants of rev')),
  2990           ('', 'template', '', _('display with template'))],
  3000           ('', 'template', '', _('display with template'))],
  2991          _('hg heads [-b] [-r <rev>]')),
  3001          _('hg heads [-b] [-r <rev>]')),
  2992     "help": (help_, [], _('hg help [COMMAND]')),
  3002     "help": (help_, [], _('hg help [COMMAND]')),
  2995         (import_,
  3005         (import_,
  2996          [('p', 'strip', 1,
  3006          [('p', 'strip', 1,
  2997            _('directory strip option for patch. This has the same\n'
  3007            _('directory strip option for patch. This has the same\n'
  2998              'meaning as the corresponding patch option')),
  3008              'meaning as the corresponding patch option')),
  2999           ('m', 'message', '', _('use <text> as commit message')),
  3009           ('m', 'message', '', _('use <text> as commit message')),
  3000           ('b', 'base', '', _('base path')),
  3010           ('b', 'base', '', _('base path (DEPRECATED)')),
  3001           ('f', 'force', None,
  3011           ('f', 'force', None,
  3002            _('skip check for outstanding uncommitted changes'))],
  3012            _('skip check for outstanding uncommitted changes'))],
  3003          _('hg import [-p NUM] [-b BASE] [-m MESSAGE] [-f] PATCH...')),
  3013          _('hg import [-p NUM] [-b BASE] [-m MESSAGE] [-f] PATCH...')),
  3004     "incoming|in": (incoming,
  3014     "incoming|in": (incoming,
  3005          [('M', 'no-merges', None, _('do not show merges')),
  3015          [('M', 'no-merges', None, _('do not show merges')),
  3025            _('print complete paths from the filesystem root')),
  3035            _('print complete paths from the filesystem root')),
  3026          ] + walkopts,
  3036          ] + walkopts,
  3027          _('hg locate [OPTION]... [PATTERN]...')),
  3037          _('hg locate [OPTION]... [PATTERN]...')),
  3028     "^log|history":
  3038     "^log|history":
  3029         (log,
  3039         (log,
  3030          [('b', 'branches', None, _('show branches')),
  3040          [('b', 'branches', None, _('show branches (DEPRECATED)')),
  3031           ('f', 'follow', None,
  3041           ('f', 'follow', None,
  3032            _('follow changeset history, or file history across copies and renames')),
  3042            _('follow changeset history, or file history across copies and renames')),
  3033           ('', 'follow-first', None,
  3043           ('', 'follow-first', None,
  3034            _('only follow the first parent of merge changesets')),
  3044            _('only follow the first parent of merge changesets')),
  3035           ('C', 'copies', None, _('show copied files')),
  3045           ('C', 'copies', None, _('show copied files')),
  3045          ] + walkopts,
  3055          ] + walkopts,
  3046          _('hg log [OPTION]... [FILE]')),
  3056          _('hg log [OPTION]... [FILE]')),
  3047     "manifest": (manifest, [], _('hg manifest [REV]')),
  3057     "manifest": (manifest, [], _('hg manifest [REV]')),
  3048     "merge":
  3058     "merge":
  3049         (merge,
  3059         (merge,
  3050          [('b', 'branch', '', _('merge with head of a specific branch')),
  3060          [('b', 'branch', '', _('merge with head of a specific branch (DEPRECATED)')),
  3051           ('f', 'force', None, _('force a merge with outstanding changes'))],
  3061           ('f', 'force', None, _('force a merge with outstanding changes'))],
  3052          _('hg merge [-b TAG] [-f] [REV]')),
  3062          _('hg merge [-b TAG] [-f] [REV]')),
  3053     "outgoing|out": (outgoing,
  3063     "outgoing|out": (outgoing,
  3054          [('M', 'no-merges', None, _('do not show merges')),
  3064          [('M', 'no-merges', None, _('do not show merges')),
  3055           ('f', 'force', None,
  3065           ('f', 'force', None,
  3061           ('', 'template', '', _('display with template')),
  3071           ('', 'template', '', _('display with template')),
  3062          ] + remoteopts,
  3072          ] + remoteopts,
  3063          _('hg outgoing [-M] [-p] [-n] [-r REV]... [DEST]')),
  3073          _('hg outgoing [-M] [-p] [-n] [-r REV]... [DEST]')),
  3064     "^parents":
  3074     "^parents":
  3065         (parents,
  3075         (parents,
  3066          [('b', 'branches', None, _('show branches')),
  3076          [('b', 'branches', None, _('show branches (DEPRECATED)')),
  3067           ('r', 'rev', '', _('show parents from the specified rev')),
  3077           ('r', 'rev', '', _('show parents from the specified rev')),
  3068           ('', 'style', '', _('display using template map file')),
  3078           ('', 'style', '', _('display using template map file')),
  3069           ('', 'template', '', _('display with template'))],
  3079           ('', 'template', '', _('display with template'))],
  3070          _('hg parents [-b] [-r REV] [FILE]')),
  3080          _('hg parents [-b] [-r REV] [FILE]')),
  3071     "paths": (paths, [], _('hg paths [NAME]')),
  3081     "paths": (paths, [], _('hg paths [NAME]')),
  3161           ('r', 'rev', '', _('revision to tag'))],
  3171           ('r', 'rev', '', _('revision to tag'))],
  3162          _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
  3172          _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
  3163     "tags": (tags, [], _('hg tags')),
  3173     "tags": (tags, [], _('hg tags')),
  3164     "tip":
  3174     "tip":
  3165         (tip,
  3175         (tip,
  3166          [('b', 'branches', None, _('show branches')),
  3176          [('b', 'branches', None, _('show branches (DEPRECATED)')),
  3167           ('', 'style', '', _('display using template map file')),
  3177           ('', 'style', '', _('display using template map file')),
  3168           ('p', 'patch', None, _('show patch')),
  3178           ('p', 'patch', None, _('show patch')),
  3169           ('', 'template', '', _('display with template'))],
  3179           ('', 'template', '', _('display with template'))],
  3170          _('hg tip [-b] [-p]')),
  3180          _('hg tip [-b] [-p]')),
  3171     "unbundle":
  3181     "unbundle":
  3174            _('update to new tip if changesets were unbundled'))],
  3184            _('update to new tip if changesets were unbundled'))],
  3175          _('hg unbundle [-u] FILE')),
  3185          _('hg unbundle [-u] FILE')),
  3176     "debugundo|undo": (undo, [], _('hg undo')),
  3186     "debugundo|undo": (undo, [], _('hg undo')),
  3177     "^update|up|checkout|co":
  3187     "^update|up|checkout|co":
  3178         (update,
  3188         (update,
  3179          [('b', 'branch', '', _('checkout the head of a specific branch')),
  3189          [('b', 'branch', '',
       
  3190            _('checkout the head of a specific branch (DEPRECATED)')),
  3180           ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')),
  3191           ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')),
  3181           ('C', 'clean', None, _('overwrite locally modified files')),
  3192           ('C', 'clean', None, _('overwrite locally modified files')),
  3182           ('f', 'force', None, _('force a merge with outstanding changes'))],
  3193           ('f', 'force', None, _('force a merge with outstanding changes'))],
  3183          _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
  3194          _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
  3184     "verify": (verify, [], _('hg verify')),
  3195     "verify": (verify, [], _('hg verify')),