GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  VCP::FILTER::SORT (3)

.ds Aq ’

NAME

VCP::Filter::sort - Sort revs by field, order

CONTENTS

SYNOPSIS



  ## From the command line:
   vcp <source> sort: name ascending rev_id ascending -- <dest>

  ## In a .vcp file:

    Sort:
       name     ascending
       rev_id   ascending



DESCRIPTION

NOTE: this filter is primarily for development and testing, it is not designed for large datasets (it can use a lot of RAM if fed enough data).

Useful with the revml: destination to get RevML output in a desired order. Otherwise the sorting built in to the change aggregator should suffice.

The default sort spec is name,rev_id which is what is handy to VCP’s test suite as it puts all revisions in a predictable order so the output revml can be compared to the input revml.

NOTE: this is primarily for development use; not all fields may work right. All plain string fields should work right as well as name, rev_id, change_id and their source_... equivalents (which are parsed and compared piece-wise) and time, and mod_tome (which are stored as integers internally).

Plain case sensitive string comparison is used for all fields other than those mentioned in the preceding paragraphs.

This sort may be slow for extremely large data sets; it sorts things by comparing revs to eachother field by field instead of by generating indexes and VCP::Rev is not designed to be super fast when accessing fields one by one. This can be altered if need be.

How rev_id and change_id are sorted

change_id or rev_id are split in to segments suitable for sorting.

The splits occur at the following points:



   1. Before and after each substring of consecutive digits
   2. Before and after each substring of consecutive letters
   3. Before and after each non-alpha-numeric character



The substrings are greedy: each is as long as possible and non-alphanumeric characters are discarded. So 11..22aa33 is split in to 5 segments: ( 11, ", 22, aa", 33 ).

If a segment is numeric, it is left padded with 10 NUL characters.

This algorithm makes 1.52 be treated like revision 1, minor revision 52, not like a floating point 1.52. So the following sort order is maintained:



   1.0
   1.0b1
   1.0b2
   1.0b10
   1.0c
   1.1
   1.2
   1.10
   1.11
   1.12



The substring pre might be treated specially at some point.

(At least) the following cases are not handled by this algorithm:



   1. floating point rev_ids: 1.0, 1.1, 1.11, 1.12, 1.2
   2. letters as "prereleases": 1.0a, 1.0b, 1.0, 1.1a, 1.1



LIMITATIONS

Stores all metadata in RAM.

AUTHOR

Barrie Slaymaker <barries@slaysys.com>

COPYRIGHT

Copyright (c) 2000, 2001, 2002 Perforce Software, Inc. All rights reserved.

See VCP::License (vcp help license) for the terms of use.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 VCP::FILTER::SORT (3) 2004-11-04

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.