source: cl-darcs/trunk/pristine.lisp

Last change on this file was 156, checked in by Magnus Henoch, 14 years ago

Add CREATE-EMPTY-PRISTINE

File size: 1.4 KB
Line 
1;;; Copyright (C) 2006, 2008 Magnus Henoch
2;;;
3;;; This program is free software; you can redistribute it and/or
4;;; modify it under the terms of the GNU General Public License as
5;;; published by the Free Software Foundation; either version 2 of the
6;;; License, or (at your option) any later version.
7;;;
8;;; This program is distributed in the hope that it will be useful,
9;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
10;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11;;; General Public License for more details.
12;;;
13;;; You should have received a copy of the GNU General Public License
14;;; along with this program; if not, write to the Free Software
15;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
16
17(in-package :darcs)
18
19(defun create-empty-pristine (repodir)
20  "Make an empty pristine tree in REPODIR."
21  (make-dir (upath-subdir repodir '("_darcs" "pristine"))))
22
23(defun create-pristine-from-tree (repodir)
24  "Copy the checked-out tree at REPODIR to get a pristine tree."
25  (let* ((darcs-dir (upath-subdir repodir '("_darcs")))
26         (pristine-dir (upath-subdir darcs-dir '("pristine"))))
27    (make-dir pristine-dir)
28    (copy-directory repodir pristine-dir :excluding (list darcs-dir))))
29
30(defun apply-patch-to-pristine (patch repodir)
31  "Apply PATCH to the pristine tree in REPODIR."
32  (apply-patch patch (upath-subdir repodir '("_darcs" "pristine"))))
Note: See TracBrowser for help on using the repository browser.