# Path: quilt/db.py
# DB_VERSION = 2
# class DBError(QuiltError):
# class PatchLine(object):
# class PatchSeries(object):
# class Db(PatchSeries):
# class Series(PatchSeries):
#     def __init__(self, patch):
#     def _parse_line(self, line):
#     def get_patch(self):
#     def get_comment(self):
#     def set_comment(self, comment):
#     def __str__(self):
#     def __init__(self, dirname, filename):
#     def _check_patch(self, patch):
#     def exists(self):
#     def read(self):
#     def save(self):
#     def add_patch(self, patch):
#     def _add_patches(self, patches):
#     def insert_patches(self, patches):
#     def add_patches(self, patches, after=None):
#     def remove_patch(self, patch):
#     def top_patch(self):
#     def first_patch(self):
#     def patches(self):
#     def _patchlines_after(self, patch):
#     def _patchlines_before(self, patch):
#     def _patchlines_until(self, patch):
#     def patches_after(self, patch):
#     def patch_after(self, patch):
#     def patches_before(self, patch):
#     def patch_before(self, patch):
#     def patches_until(self, patch):
#     def is_patch(self, patch):
#     def is_empty(self):
#     def replace(self, old_patch, new_patch):
#     def __init__(self, dirname):
#     def _create_version(self, version_file):
#     def create(self):
#     def save(self):
#     def applied_patches(self):
#     def check_version(self, version_file):
#     def __init__(self, dirname):
# 
# Path: quilt/utils.py
# class TmpDirectory(Directory):
#     """ Creates a temporary directory and can be used as a context manager.
#     If used with as a context manager in a with statement the temporary
#     directory is deleted automatically.
#     """
# 
#     def __init__(self, suffix="", prefix="temp", dir=None):
#         tmp_dir = tempfile.mkdtemp(suffix, prefix, dir)
#         super(TmpDirectory, self).__init__(tmp_dir)
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_value, traceback):
#         self.delete()


import os
import quilt.refresh
from helpers import make_file
from unittest import TestCase
from quilt.db import Db, Patch
from quilt.utils import TmpDirectory
# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:

# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.






class Test(TestCase):

    def test_refresh(self):
        with TmpDirectory() as dir:
            old_dir = os.getcwd()
            try:
                os.chdir(dir.get_name())
                db = Db(".pc")
                db.create()

# Path: quilt/db.py
# DB_VERSION = 2
# class DBError(QuiltError):
# class PatchLine(object):
# class PatchSeries(object):
# class Db(PatchSeries):
# class Series(PatchSeries):
#     def __init__(self, patch):
#     def _parse_line(self, line):
#     def get_patch(self):
#     def get_comment(self):
#     def set_comment(self, comment):
#     def __str__(self):
#     def __init__(self, dirname, filename):
#     def _check_patch(self, patch):
#     def exists(self):
#     def read(self):
#     def save(self):
#     def add_patch(self, patch):
#     def _add_patches(self, patches):
#     def insert_patches(self, patches):
#     def add_patches(self, patches, after=None):
#     def remove_patch(self, patch):
#     def top_patch(self):
#     def first_patch(self):
#     def patches(self):
#     def _patchlines_after(self, patch):
#     def _patchlines_before(self, patch):
#     def _patchlines_until(self, patch):
#     def patches_after(self, patch):
#     def patch_after(self, patch):
#     def patches_before(self, patch):
#     def patch_before(self, patch):
#     def patches_until(self, patch):
#     def is_patch(self, patch):
#     def is_empty(self):
#     def replace(self, old_patch, new_patch):
#     def __init__(self, dirname):
#     def _create_version(self, version_file):
#     def create(self):
#     def save(self):
#     def applied_patches(self):
#     def check_version(self, version_file):
#     def __init__(self, dirname):
# 
# Path: quilt/utils.py
# class TmpDirectory(Directory):
#     """ Creates a temporary directory and can be used as a context manager.
#     If used with as a context manager in a with statement the temporary
#     directory is deleted automatically.
#     """
# 
#     def __init__(self, suffix="", prefix="temp", dir=None):
#         tmp_dir = tempfile.mkdtemp(suffix, prefix, dir)
#         super(TmpDirectory, self).__init__(tmp_dir)
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_value, traceback):
#         self.delete()


# Path: tests/test_refresh.py
import os
import quilt.refresh
from helpers import make_file
from unittest import TestCase
from quilt.db import Db, Patch
from quilt.utils import TmpDirectory

# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:

# python-quilt - A Python implementation of the quilt patch system
#
# See LICENSE comming with the source of python-quilt for details.






class Test(TestCase):

    def test_refresh(self):
        with TmpDirectory() as dir:
            old_dir = os.getcwd()
            try:
                os.chdir(dir.get_name())
                db = Db(".pc")
                db.create()

                backup = os.path.join(".pc", "patch")