[rfc][patch]
Erik Bågfors
zindar at gmail.com
Sat Dec 24 22:22:36 GMT 2005
>
> > === modified file 'bzrlib/builtins.py'
> > --- bzrlib/builtins.py
> > +++ bzrlib/builtins.py
> > @@ -395,10 +395,10 @@
> > If you want to forget your local changes and just update your branch to
> > match the remote one, use --overwrite.
> > """
> > - takes_options = ['remember', 'overwrite', 'verbose']
> > + takes_options = ['remember', 'overwrite', 'revision', 'verbose']
> > takes_args = ['location?']
> >
> > - def run(self, location=None, remember=False, overwrite=False, verbose=False):
> > + def run(self, location=None, remember=False, overwrite=False, revision=None, verbose=False):
> > from bzrlib.merge import merge
> > from shutil import rmtree
> > import errno
> > @@ -415,8 +415,13 @@
> > br_from = Branch.open(location)
> > br_to = tree_to.branch
> >
> > + if len(revision) == 1:
> > + rev_id = revision[0]._match_on(br_from,br_from.revision_history()).rev_id
> > + elif len(revision) > 1:
> > + raise BzrCommandError('bzr pull --revision takes one value.')
> > +
>
> At this point, you have to realize that 'revision' may be a list
> (because --revision was supplied), or it may be None (no '--revision'
> was supplied).
>
> So you really need something more like:
>
> if revision is None:
> rev_id = None
> elif len(revision) == 1:
> rev_id = revision[0]._match_on(...
> else:
> raise BzrCommandError('...
I'm a perl programmer. I am used to using implicit undefined etc. But
it did work. Changed as you wanted. :)
> > old_rh = br_to.revision_history()
> > - count = tree_to.pull(br_from, overwrite)
> > + count = tree_to.pull(br_from, overwrite, revision[0]._match_on(br_from,br_from.revision_history()).rev_id)
>
> And then here, you don't want to get the match again, you just want to say:
>
> count = tree.pull(br_from, overwrite, stop_revision=rev_id)
Oh, that was just a mistake.
Both fixed. In the same place.
Regards,
Erik
More information about the bazaar
mailing list