comparison mercurial/commands.py @ 1600:728fd9584993

add --update support to 'hg unbundle'
author Muli Ben-Yehuda <mulix@mulix.org>
date Tue, 27 Dec 2005 16:16:06 -0600
parents 41366b7d6709
children a1b25fb2e764
comparison
equal deleted inserted replaced
1599:f93fde8f5027 1600:728fd9584993
2093 Show the tip revision. 2093 Show the tip revision.
2094 """ 2094 """
2095 n = repo.changelog.tip() 2095 n = repo.changelog.tip()
2096 show_changeset(ui, repo, changenode=n) 2096 show_changeset(ui, repo, changenode=n)
2097 2097
2098 def unbundle(ui, repo, fname): 2098 def unbundle(ui, repo, fname, **opts):
2099 """apply a changegroup file 2099 """apply a changegroup file
2100 2100
2101 Apply a compressed changegroup file generated by the bundle 2101 Apply a compressed changegroup file generated by the bundle
2102 command. 2102 command.
2103 """ 2103 """
2111 for chunk in f: 2111 for chunk in f:
2112 yield zd.decompress(chunk) 2112 yield zd.decompress(chunk)
2113 2113
2114 bzgen = bzgenerator(util.filechunkiter(f, 4096)) 2114 bzgen = bzgenerator(util.filechunkiter(f, 4096))
2115 repo.addchangegroup(util.chunkbuffer(bzgen)) 2115 repo.addchangegroup(util.chunkbuffer(bzgen))
2116 if opts['update']:
2117 return update(ui, repo)
2118 else:
2119 ui.status(_("(run 'hg update' to get a working copy)\n"))
2116 2120
2117 def undo(ui, repo): 2121 def undo(ui, repo):
2118 """undo the last commit or pull 2122 """undo the last commit or pull
2119 2123
2120 Roll back the last pull or commit transaction on the 2124 Roll back the last pull or commit transaction on the
2404 _('hg tag [OPTION]... NAME [REV]')), 2408 _('hg tag [OPTION]... NAME [REV]')),
2405 "tags": (tags, [], _('hg tags')), 2409 "tags": (tags, [], _('hg tags')),
2406 "tip": (tip, [], _('hg tip')), 2410 "tip": (tip, [], _('hg tip')),
2407 "unbundle": 2411 "unbundle":
2408 (unbundle, 2412 (unbundle,
2409 [], 2413 [('u', 'update', None, _('update the working directory to tip after unbundle'))],
2410 _('hg unbundle FILE')), 2414 _('hg unbundle [-u] FILE')),
2411 "undo": (undo, [], _('hg undo')), 2415 "undo": (undo, [], _('hg undo')),
2412 "^update|up|checkout|co": 2416 "^update|up|checkout|co":
2413 (update, 2417 (update,
2414 [('b', 'branch', "", _('checkout the head of a specific branch')), 2418 [('b', 'branch', "", _('checkout the head of a specific branch')),
2415 ('m', 'merge', None, _('allow merging of branches')), 2419 ('m', 'merge', None, _('allow merging of branches')),