mercurial/commands.py
changeset 1581 db10b7114de0
parent 1571 bcdc030c59f8
child 1586 5c5aaaa9ab6f
equal deleted inserted replaced
1580:4737b36e324e 1581:db10b7114de0
  2133     a change is visible for pull by other users, undoing it locally is
  2133     a change is visible for pull by other users, undoing it locally is
  2134     ineffective.
  2134     ineffective.
  2135     """
  2135     """
  2136     repo.undo()
  2136     repo.undo()
  2137 
  2137 
  2138 def update(ui, repo, node=None, merge=False, clean=False, branch=None):
  2138 def update(ui, repo, node=None, merge=False, clean=False, force=None,
       
  2139            branch=None):
  2139     """update or merge working directory
  2140     """update or merge working directory
  2140 
  2141 
  2141     Update the working directory to the specified revision.
  2142     Update the working directory to the specified revision.
  2142 
  2143 
  2143     If there are no outstanding changes in the working directory and
  2144     If there are no outstanding changes in the working directory and
  2170         else:
  2171         else:
  2171             ui.warn(_("branch %s not found\n") % (branch))
  2172             ui.warn(_("branch %s not found\n") % (branch))
  2172             return 1
  2173             return 1
  2173     else:
  2174     else:
  2174         node = node and repo.lookup(node) or repo.changelog.tip()
  2175         node = node and repo.lookup(node) or repo.changelog.tip()
  2175     return repo.update(node, allow=merge, force=clean)
  2176     return repo.update(node, allow=merge, force=clean, forcemerge=force)
  2176 
  2177 
  2177 def verify(ui, repo):
  2178 def verify(ui, repo):
  2178     """verify the integrity of the repository
  2179     """verify the integrity of the repository
  2179 
  2180 
  2180     Verify the integrity of the current repository.
  2181     Verify the integrity of the current repository.
  2416     "undo": (undo, [], _('hg undo')),
  2417     "undo": (undo, [], _('hg undo')),
  2417     "^update|up|checkout|co":
  2418     "^update|up|checkout|co":
  2418         (update,
  2419         (update,
  2419          [('b', 'branch', "", _('checkout the head of a specific branch')),
  2420          [('b', 'branch', "", _('checkout the head of a specific branch')),
  2420           ('m', 'merge', None, _('allow merging of branches')),
  2421           ('m', 'merge', None, _('allow merging of branches')),
  2421           ('C', 'clean', None, _('overwrite locally modified files'))],
  2422           ('C', 'clean', None, _('overwrite locally modified files')),
  2422          _('hg update [-b TAG] [-m] [-C] [REV]')),
  2423           ('f', 'force', None, _('force a merge with outstanding changes'))],
       
  2424          _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
  2423     "verify": (verify, [], _('hg verify')),
  2425     "verify": (verify, [], _('hg verify')),
  2424     "version": (show_version, [], _('hg version')),
  2426     "version": (show_version, [], _('hg version')),
  2425 }
  2427 }
  2426 
  2428 
  2427 globalopts = [
  2429 globalopts = [