| Index: utils/pub/lock_file.dart
 | 
| diff --git a/utils/pub/lock_file.dart b/utils/pub/lock_file.dart
 | 
| index 92575fa9f5bd435f756c5c56ba641814c910fe76..d4227be2df7f939663cb2fce35846ced18fe13ad 100644
 | 
| --- a/utils/pub/lock_file.dart
 | 
| +++ b/utils/pub/lock_file.dart
 | 
| @@ -4,6 +4,7 @@
 | 
|  
 | 
|  #library('lock_file');
 | 
|  
 | 
| +#import('dart:json');
 | 
|  #import('package.dart');
 | 
|  #import('source_registry.dart');
 | 
|  #import('utils.dart');
 | 
| @@ -60,7 +61,7 @@ class LockFile {
 | 
|            throw new FormatException('Package $name is missing a description.');
 | 
|          }
 | 
|          var description = spec['description'];
 | 
| -        source.validateDescription(description);
 | 
| +        source.validateDescription(description, fromLockFile: true);
 | 
|  
 | 
|          var id = new PackageId(source, version, description);
 | 
|  
 | 
| @@ -76,4 +77,22 @@ class LockFile {
 | 
|  
 | 
|      return new LockFile._(packages);
 | 
|    }
 | 
| +
 | 
| +  /**
 | 
| +   * Returns the serialized YAML text of the lock file.
 | 
| +   */
 | 
| +  String serialize() {
 | 
| +    var packagesObj = <Map>{};
 | 
| +    packages.forEach((name, id) {
 | 
| +      packagesObj[name] = {
 | 
| +        'version': id.version.toString(),
 | 
| +        'source': id.source.name,
 | 
| +        'description': id.description
 | 
| +      };
 | 
| +    });
 | 
| +
 | 
| +    // TODO(nweiz): Serialize using the YAML library once it supports
 | 
| +    // serialization. For now, we use JSON, since it's a subset of YAML anyway.
 | 
| +    return JSON.stringify({'packages': packagesObj});
 | 
| +  }
 | 
|  }
 | 
| 
 |