392
392
If you want to forget your local changes and just update your branch to
393
393
match the remote one, use --overwrite.
395
takes_options = ['remember', 'overwrite', 'verbose']
395
takes_options = ['remember', 'overwrite', 'revision', 'verbose']
396
396
takes_args = ['location?']
398
def run(self, location=None, remember=False, overwrite=False, verbose=False):
398
def run(self, location=None, remember=False, overwrite=False, revision=None, verbose=False):
399
399
from shutil import rmtree
401
401
# FIXME: too much stuff is in the command class
411
411
br_from = Branch.open(location)
412
412
br_to = tree_to.branch
416
elif len(revision) == 1:
417
rev_id = revision[0].in_history(br_from).rev_id
419
raise BzrCommandError('bzr pull --revision takes one value.')
414
421
old_rh = br_to.revision_history()
415
count = tree_to.pull(br_from, overwrite)
422
count = tree_to.pull(br_from, overwrite, rev_id)
417
424
if br_to.get_parent() is None or remember:
418
425
br_to.set_parent(location)
942
949
rev1 = rev2 = revision[0].in_history(b).revno
943
950
elif len(revision) == 2:
944
951
rev1 = revision[0].in_history(b).revno
945
rev2 = revision[1].in_history(b).revno
952
if revision[1].spec is None:
953
# missing end-range means last known revision
956
rev2 = revision[1].in_history(b).revno
947
958
raise BzrCommandError('bzr log --revision takes one or two values.')
1171
1182
Note: export of tree with non-ascii filenames to zip is not supported.
1173
Supported formats Autodetected by extension
1174
----------------- -------------------------
1184
Supported formats Autodetected by extension
1185
----------------- -------------------------
1177
1188
tbz2 .tar.bz2, .tbz2
1395
1406
class cmd_nick(Command):
1397
Print or set the branch nickname.
1407
"""Print or set the branch nickname.
1398
1409
If unset, the tree root directory name is used as the nickname
1399
1410
To print the current nickname, execute with no argument.
1556
1567
last1 = branch1.last_revision()
1557
1568
last2 = branch2.last_revision()
1559
source = MultipleRevisionSources(branch1, branch2)
1570
source = MultipleRevisionSources(branch1.repository,
1561
1573
base_rev_id = common_ancestor(last1, last2, source)
1943
1955
# TODO be able to replace existing ones.
1945
1957
hidden = True # is this right ?
1946
takes_args = ['revision_id?']
1958
takes_args = ['revision_id*']
1947
1959
takes_options = ['revision']
1949
def run(self, revision_id=None, revision=None):
1961
def run(self, revision_id_list=None, revision=None):
1950
1962
import bzrlib.config as config
1951
1963
import bzrlib.gpg as gpg
1952
if revision_id is not None and revision is not None:
1964
if revision_id_list is not None and revision is not None:
1953
1965
raise BzrCommandError('You can only supply one of revision_id or --revision')
1954
if revision_id is None and revision is None:
1966
if revision_id_list is None and revision is None:
1955
1967
raise BzrCommandError('You must supply either --revision or a revision_id')
1956
1968
b = WorkingTree.open_containing(u'.')[0].branch
1957
1969
gpg_strategy = gpg.GPGStrategy(config.BranchConfig(b))
1958
if revision_id is not None:
1959
b.repository.sign_revision(revision_id, gpg_strategy)
1970
if revision_id_list is not None:
1971
for revision_id in revision_id_list:
1972
b.repository.sign_revision(revision_id, gpg_strategy)
1960
1973
elif revision is not None:
1961
1974
if len(revision) == 1:
1962
1975
revno, rev_id = revision[0].in_history(b)