comparison mercurial/commands.py @ 13663:d16c99f16f00

bundle: update current bookmark to most recent revision on current branch We check if the current bookmark is set to the first parent of the dirstate. Is this the case we move the bookmark to most recent revision on the current branch (where hg update will update you to).
author David Soria Parra <dsp@php.net>
date Mon, 14 Mar 2011 23:03:56 +0100
parents 31eac42d9123
children e798e430c5e5
comparison
equal deleted inserted replaced
13662:80d6e1f63ed9 13663:d16c99f16f00
4036 Returns 0 on success, 1 if an update has unresolved files. 4036 Returns 0 on success, 1 if an update has unresolved files.
4037 """ 4037 """
4038 fnames = (fname1,) + fnames 4038 fnames = (fname1,) + fnames
4039 4039
4040 lock = repo.lock() 4040 lock = repo.lock()
4041 wc = repo['.']
4041 try: 4042 try:
4042 for fname in fnames: 4043 for fname in fnames:
4043 f = url.open(ui, fname) 4044 f = url.open(ui, fname)
4044 gen = changegroup.readbundle(f, fname) 4045 gen = changegroup.readbundle(f, fname)
4045 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname, 4046 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname,
4046 lock=lock) 4047 lock=lock)
4048 bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch())
4047 finally: 4049 finally:
4048 lock.release() 4050 lock.release()
4049
4050 return postincoming(ui, repo, modheads, opts.get('update'), None) 4051 return postincoming(ui, repo, modheads, opts.get('update'), None)
4051 4052
4052 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False): 4053 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False):
4053 """update working directory (or switch revisions) 4054 """update working directory (or switch revisions)
4054 4055