mercurial/commands.py
changeset 10882 f0bfe42c7b1f
parent 10835 6e876718d0cf
child 10889 e25c450c351e
equal deleted inserted replaced
10881:a685011ed38e 10882:f0bfe42c7b1f
  2852                 normal(f)
  2852                 normal(f)
  2853 
  2853 
  2854     finally:
  2854     finally:
  2855         wlock.release()
  2855         wlock.release()
  2856 
  2856 
  2857 def rollback(ui, repo):
  2857 def rollback(ui, repo, **opts):
  2858     """roll back the last transaction
  2858     """roll back the last transaction
  2859 
  2859 
  2860     This command should be used with care. There is only one level of
  2860     This command should be used with care. There is only one level of
  2861     rollback, and there is no way to undo a rollback. It will also
  2861     rollback, and there is no way to undo a rollback. It will also
  2862     restore the dirstate at the time of the last transaction, losing
  2862     restore the dirstate at the time of the last transaction, losing
  2879     back locally is ineffective (someone else may already have pulled
  2879     back locally is ineffective (someone else may already have pulled
  2880     the changes). Furthermore, a race is possible with readers of the
  2880     the changes). Furthermore, a race is possible with readers of the
  2881     repository; for example an in-progress pull from the repository
  2881     repository; for example an in-progress pull from the repository
  2882     may fail if a rollback is performed.
  2882     may fail if a rollback is performed.
  2883     """
  2883     """
  2884     repo.rollback()
  2884     repo.rollback(opts.get('dry_run'))
  2885 
  2885 
  2886 def root(ui, repo):
  2886 def root(ui, repo):
  2887     """print the root (top) of the current working directory
  2887     """print the root (top) of the current working directory
  2888 
  2888 
  2889     Print the root directory of the current repository.
  2889     Print the root directory of the current repository.
  3819           ('d', 'date', '', _('tipmost revision matching date')),
  3819           ('d', 'date', '', _('tipmost revision matching date')),
  3820           ('r', 'rev', '', _('revert to the specified revision')),
  3820           ('r', 'rev', '', _('revert to the specified revision')),
  3821           ('', 'no-backup', None, _('do not save backup copies of files')),
  3821           ('', 'no-backup', None, _('do not save backup copies of files')),
  3822          ] + walkopts + dryrunopts,
  3822          ] + walkopts + dryrunopts,
  3823          _('[OPTION]... [-r REV] [NAME]...')),
  3823          _('[OPTION]... [-r REV] [NAME]...')),
  3824     "rollback": (rollback, []),
  3824     "rollback": (rollback, dryrunopts),
  3825     "root": (root, []),
  3825     "root": (root, []),
  3826     "^serve":
  3826     "^serve":
  3827         (serve,
  3827         (serve,
  3828          [('A', 'accesslog', '', _('name of access log file to write to')),
  3828          [('A', 'accesslog', '', _('name of access log file to write to')),
  3829           ('d', 'daemon', None, _('run server in background')),
  3829           ('d', 'daemon', None, _('run server in background')),