/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Matthieu Moy
  • Date: 2006-08-02 12:10:47 UTC
  • mto: (2009.1.1 update-r)
  • mto: This revision was merged to the branch mainline in revision 4923.
  • Revision ID: Matthieu.Moy@imag.fr-20060802121047-7cd8452059a75e8a
variable renaming (last_rev -> rev) + test if the revision is in branch history.

Show diffs side-by-side

added added

removed removed

Lines of Context:
822
822
        try:
823
823
            old_tip = b.update()
824
824
            if revision is not None:
825
 
                last_rev = revision[0].in_history(b).rev_id
 
825
                rev = revision[0].in_history(b).rev_id
 
826
                if rev not in b.revision_history():
 
827
                    raise BzrCommandError("bzr update --revision works only for a revision in the branch history")
826
828
            else:
827
 
                last_rev = b.last_revision()
828
 
            if tree.last_revision() == last_rev:
 
829
                rev = b.last_revision()
 
830
            if tree.last_revision() == rev:
829
831
                # may be up to date, check master too.
830
832
                master = b.get_master_branch()
831
 
                if master is None or last_rev == master.last_revision():
832
 
                    revno = b.revision_id_to_revno(last_rev)
 
833
                if master is None or rev == master.last_revision():
 
834
                    revno = b.revision_id_to_revno(rev)
833
835
                    note("Tree is up to date at revision %d." % (revno,))
834
836
                    return 0
835
 
            conflicts = tree.update(last_rev,old_tip or "not_computed")
 
837
            conflicts = tree.update(rev,old_tip or "not_computed")
836
838
            try:
837
839
                revno = str(b.revision_id_to_revno(tree.last_revision()))
838
840
            except errors.NoSuchRevision:
839
 
                revno = last_rev
 
841
                revno = rev
840
842
            note('Updated to revision %s.' % (revno,))
841
843
            if tree.pending_merges() != existing_pending_merges:
842
844
                note('Your local commits will now show as pending merges with '