~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/generate_ids.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-12 16:54:35 UTC
  • mto: (5148.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5151.
  • Revision ID: v.ladeuil+lp@free.fr-20100412165435-gzdnwuybj9rvddiz
Fix bug #519319 by defaulting to a warning for dirty trees.

* bzrlib/mutabletree.py:
(MutableTree.warn_if_changed_or_out_of_date): Factor out the
checks done by send, push and dpush.

* bzrlib/send.py:
(send): Use warn_if_changed_or_out_of_date().

* bzrlib/foreign.py:
(cmd_dpush.run): Use warn_if_changed_or_out_of_date().

* bzrlib/builtins.py:
(cmd_push.run): Use warn_if_changed_or_out_of_date().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009, 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
from bzrlib.lazy_import import lazy_import
20
20
lazy_import(globals(), """
21
21
import time
 
22
import unicodedata
22
23
 
23
24
from bzrlib import (
24
25
    config,
92
93
def gen_revision_id(username, timestamp=None):
93
94
    """Return new revision-id.
94
95
 
95
 
    :param username: The username of the committer, in the format returned by
96
 
        config.username().  This is typically a real name, followed by an
97
 
        email address. If found, we will use just the email address portion.
98
 
        Otherwise we flatten the real name, and use that.
 
96
    :param username: This is the value returned by config.username(), which is
 
97
        typically a real name, followed by an email address. If found, we will
 
98
        use just the email address portion. Otherwise we flatten the real name,
 
99
        and use that.
99
100
    :return: A new revision id.
100
101
    """
101
102
    try: