Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 13568:0b79cf616e65
commands.update() now works properly with a revision of 0
Without this change commands.update() treats an integer 0 as if no revision
was passed and updates to the branch head. This fix allows an integer 0 to
be detected as a revision number so the working directory is correctly
changed to revision 0 rather than the branch head.
author | Mark Drago <markdrago@gmail.com> |
---|---|
date | Tue, 08 Mar 2011 08:41:39 -0500 |
parents | 0fb2ff949790 |
children | edd06611a7c6 |
comparison
equal
deleted
inserted
replaced
13567:cc27c31ebc28 | 13568:0b79cf616e65 |
---|---|
4051 Returns 0 on success, 1 if there are unresolved files. | 4051 Returns 0 on success, 1 if there are unresolved files. |
4052 """ | 4052 """ |
4053 if rev and node: | 4053 if rev and node: |
4054 raise util.Abort(_("please specify just one revision")) | 4054 raise util.Abort(_("please specify just one revision")) |
4055 | 4055 |
4056 if not rev: | 4056 if rev is None or rev == '': |
4057 rev = node | 4057 rev = node |
4058 | 4058 |
4059 # if we defined a bookmark, we have to remember the original bookmark name | 4059 # if we defined a bookmark, we have to remember the original bookmark name |
4060 brev = rev | 4060 brev = rev |
4061 rev = cmdutil.revsingle(repo, rev, rev).rev() | 4061 rev = cmdutil.revsingle(repo, rev, rev).rev() |