~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revisionspec.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
import re
273
273
        # this is mostly for helping with testing
274
274
        return '<%s %s>' % (self.__class__.__name__,
275
275
                              self.user_spec)
276
 
    
 
276
 
277
277
    def needs_branch(self):
278
278
        """Whether this revision spec needs a branch.
279
279
 
283
283
 
284
284
    def get_branch(self):
285
285
        """When the revision specifier contains a branch location, return it.
286
 
        
 
286
 
287
287
        Otherwise, return None.
288
288
        """
289
289
        return None
340
340
                dotted = False
341
341
            except ValueError:
342
342
                # dotted decimal. This arguably should not be here
343
 
                # but the from_string method is a little primitive 
 
343
                # but the from_string method is a little primitive
344
344
                # right now - RBC 20060928
345
345
                try:
346
346
                    match_revno = tuple((int(number) for number in revno_spec.split('.')))
396
396
        else:
397
397
            return self.spec[self.spec.find(':')+1:]
398
398
 
399
 
# Old compatibility 
 
399
# Old compatibility
400
400
RevisionSpec_int = RevisionSpec_revno
401
401
 
402
402
 
407
407
    help_txt = """Selects a revision using the revision id.
408
408
 
409
409
    Supply a specific revision id, that can be used to specify any
410
 
    revision id in the ancestry of the branch. 
 
410
    revision id in the ancestry of the branch.
411
411
    Including merges, and pending merges.
412
412
    Examples::
413
413
 
502
502
    """
503
503
 
504
504
    prefix = 'before:'
505
 
    
 
505
 
506
506
    def _match_on(self, branch, revs):
507
507
        r = RevisionSpec.from_string(self.spec)._match_on(branch, revs)
508
508
        if r.revno == 0:
612
612
      date:yesterday            -> select the first revision since yesterday
613
613
      date:2006-08-14,17:10:14  -> select the first revision after
614
614
                                   August 14th, 2006 at 5:10pm.
615
 
    """    
 
615
    """
616
616
    prefix = 'date:'
617
617
    _date_re = re.compile(
618
618
            r'(?P<date>(?P<year>\d\d\d\d)-(?P<month>\d\d)-(?P<day>\d\d))?'