Changeset 1508


Ignore:
Timestamp:
Aug 31, 2012, 1:22:43 PM (7 years ago)
Author:
Peter Johansson
Message:

fixes #521. copy svncopyright cache files as well.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/CacheCopyer.cc

    r1449 r1508  
    3232#include <string>
    3333
     34#include <iostream>
     35
    3436namespace theplu {
    3537namespace svndigest {
     
    4042
    4143
    42   bool CacheCopyer::enter(Directory& dir)
     44  void
     45  CacheCopyer::copy(const std::string& src, const std::string& trg_dir) const
     46  {
     47    if (!node_exist(src))
     48      return;
     49    if (access_rights(src, "r"))
     50      throw yat::utility::errno_error("'" + src + "': ");
     51    std::string target_file =
     52      concatenate_path(trg_dir, file_name(src));
     53
     54    if (verbose_)
     55      std::cout << src << " -> " << target_file << "\n";
     56    copy_file(src, target_file);
     57  }
     58
     59
     60  bool CacheCopyer::enter(Directory& dir)
    4361  {
    4462    if (dir.svndigest_ignore() && dir.svncopyright_ignore())
     
    5270    return true;
    5371  }
    54  
    5572
    56   void CacheCopyer::leave(Directory& dir)
     73
     74  void CacheCopyer::leave(Directory& dir)
    5775  {
    5876  }
    59  
     77
    6078
    6179  void CacheCopyer::visit(File& file)
     
    6482      return;
    6583    std::string src_file = file.cache_name();
    66     if (!node_exist(src_file))
    67       return;
    68     if (access_rights(src_file, "r"))
    69       throw yat::utility::errno_error(src_file + ": ");
    70     std::string target_file =
    71       concatenate_path(target_, directory_name(file.local_path()));
    72     target_file = concatenate_path(target_file,
    73                                    ".svndigest/"+file_name(src_file));
    74     if (verbose_)
    75       std::cout << src_file << " -> " << target_file << "\n";
    76     copy_file(src_file, target_file);
     84
     85    std::string target_dir =
     86      concatenate_path(target_,
     87                       directory_name(file.local_path())+"/.svndigest");
     88
     89    if (!file.svndigest_ignore())
     90      copy(src_file, target_dir);
     91
     92    replace(src_file, "svndigest-cache", "svncopyright-cache");
     93    if (!file.svncopyright_ignore())
     94      copy(src_file, target_dir);
     95
    7796  }
    7897
  • trunk/lib/CacheCopyer.h

    r1293 r1508  
    5252
    5353    /**
    54        Updating copyright in \a file 
     54       Updating copyright in \a file
    5555     */
    5656    void visit(File& file);
    5757
    5858  private:
     59    void copy(const std::string& src, const std::string& trg_dir) const;
     60
    5961    std::string target_;
    6062    bool verbose_;
  • trunk/test/Makefile.am

    r1506 r1508  
    6464
    6565# tests not yet passing are listed here
    66 XFAIL_TESTS = svndigest_copy_cache_test2.sh
     66XFAIL_TESTS =
    6767
    6868noinst_HEADERS = Suite.h
Note: See TracChangeset for help on using the changeset viewer.