~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-22 14:18:17 UTC
  • mto: (5190.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100422141817-izoao20264ivkauo
Explain that the uncommitted changes are not processed when
issuing the warning.

* bzrlib/mutabletree.py:
(MutableTree.check_changed_or_out_of_date): Use diferent 'more'
arguments depending on whether we issue a warning or an error.

* bzrlib/send.py:
(send): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/foreign.py:
(cmd_dpush.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/builtins.py:
(cmd_push.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
    'direction': 'reverse',
221
221
    'levels': 1,
222
222
    'generate_tags': True,
223
 
    'exclude_common_ancestry': False,
224
223
    '_match_using_deltas': True,
225
224
    }
226
225
 
227
226
 
228
227
def make_log_request_dict(direction='reverse', specific_fileids=None,
229
 
                          start_revision=None, end_revision=None, limit=None,
230
 
                          message_search=None, levels=1, generate_tags=True,
231
 
                          delta_type=None,
232
 
                          diff_type=None, _match_using_deltas=True,
233
 
                          exclude_common_ancestry=False,
234
 
                          ):
 
228
    start_revision=None, end_revision=None, limit=None,
 
229
    message_search=None, levels=1, generate_tags=True, delta_type=None,
 
230
    diff_type=None, _match_using_deltas=True):
235
231
    """Convenience function for making a logging request dictionary.
236
232
 
237
233
    Using this function may make code slightly safer by ensuring
275
271
      algorithm used for matching specific_fileids. This parameter
276
272
      may be removed in the future so bzrlib client code should NOT
277
273
      use it.
278
 
 
279
 
    :param exclude_common_ancestry: Whether -rX..Y should be interpreted as a
280
 
      range operator or as a graph difference.
281
274
    """
282
275
    return {
283
276
        'direction': direction,
290
283
        'generate_tags': generate_tags,
291
284
        'delta_type': delta_type,
292
285
        'diff_type': diff_type,
293
 
        'exclude_common_ancestry': exclude_common_ancestry,
294
286
        # Add 'private' attributes for features that may be deprecated
295
287
        '_match_using_deltas': _match_using_deltas,
296
288
    }
467
459
            self.branch, self.start_rev_id, self.end_rev_id,
468
460
            rqst.get('direction'),
469
461
            generate_merge_revisions=generate_merge_revisions,
470
 
            delayed_graph_generation=delayed_graph_generation,
471
 
            exclude_common_ancestry=rqst.get('exclude_common_ancestry'))
 
462
            delayed_graph_generation=delayed_graph_generation)
472
463
 
473
464
        # Apply the other filters
474
465
        return make_log_rev_iterator(self.branch, view_revisions,
483
474
        rqst = self.rqst
484
475
        view_revisions = _calc_view_revisions(
485
476
            self.branch, self.start_rev_id, self.end_rev_id,
486
 
            rqst.get('direction'), generate_merge_revisions=True,
487
 
            exclude_common_ancestry=rqst.get('exclude_common_ancestry'))
 
477
            rqst.get('direction'), generate_merge_revisions=True)
488
478
        if not isinstance(view_revisions, list):
489
479
            view_revisions = list(view_revisions)
490
480
        view_revisions = _filter_revisions_touching_file_id(self.branch,
495
485
 
496
486
 
497
487
def _calc_view_revisions(branch, start_rev_id, end_rev_id, direction,
498
 
                         generate_merge_revisions,
499
 
                         delayed_graph_generation=False,
500
 
                         exclude_common_ancestry=False,
501
 
                         ):
 
488
    generate_merge_revisions, delayed_graph_generation=False):
502
489
    """Calculate the revisions to view.
503
490
 
504
491
    :return: An iterator of (revision_id, dotted_revno, merge_depth) tuples OR
505
492
             a list of the same tuples.
506
493
    """
507
 
    if (exclude_common_ancestry and start_rev_id == end_rev_id):
508
 
        raise errors.BzrCommandError(
509
 
            '--exclude-common-ancestry requires two different revisions')
510
494
    if direction not in ('reverse', 'forward'):
511
495
        raise ValueError('invalid direction %r' % direction)
512
496
    br_revno, br_rev_id = branch.last_revision_info()
527
511
            iter_revs = reversed(iter_revs)
528
512
    else:
529
513
        iter_revs = _generate_all_revisions(branch, start_rev_id, end_rev_id,
530
 
                                            direction, delayed_graph_generation,
531
 
                                            exclude_common_ancestry)
 
514
                                            direction, delayed_graph_generation)
532
515
        if direction == 'forward':
533
516
            iter_revs = _rebase_merge_depth(reverse_by_depth(list(iter_revs)))
534
517
    return iter_revs
559
542
 
560
543
 
561
544
def _generate_all_revisions(branch, start_rev_id, end_rev_id, direction,
562
 
                            delayed_graph_generation,
563
 
                            exclude_common_ancestry=False):
 
545
                            delayed_graph_generation):
564
546
    # On large trees, generating the merge graph can take 30-60 seconds
565
547
    # so we delay doing it until a merge is detected, incrementally
566
548
    # returning initial (non-merge) revisions while we can.
612
594
    # indented at the end seems slightly nicer in that case.
613
595
    view_revisions = chain(iter(initial_revisions),
614
596
        _graph_view_revisions(branch, start_rev_id, end_rev_id,
615
 
                              rebase_initial_depths=(direction == 'reverse'),
616
 
                              exclude_common_ancestry=exclude_common_ancestry))
 
597
                              rebase_initial_depths=(direction == 'reverse')))
617
598
    return view_revisions
618
599
 
619
600
 
678
659
 
679
660
 
680
661
def _graph_view_revisions(branch, start_rev_id, end_rev_id,
681
 
                          rebase_initial_depths=True,
682
 
                          exclude_common_ancestry=False):
 
662
                          rebase_initial_depths=True):
683
663
    """Calculate revisions to view including merges, newest to oldest.
684
664
 
685
665
    :param branch: the branch
689
669
      revision is found?
690
670
    :return: An iterator of (revision_id, dotted_revno, merge_depth) tuples.
691
671
    """
692
 
    if exclude_common_ancestry:
693
 
        stop_rule = 'with-merges-without-common-ancestry'
694
 
    else:
695
 
        stop_rule = 'with-merges'
696
672
    view_revisions = branch.iter_merge_sorted_revisions(
697
673
        start_revision_id=end_rev_id, stop_revision_id=start_rev_id,
698
 
        stop_rule=stop_rule)
 
674
        stop_rule="with-merges")
699
675
    if not rebase_initial_depths:
700
676
        for (rev_id, merge_depth, revno, end_of_merge
701
677
             ) in view_revisions: