Skip to content

Commit

Permalink
完善脚本,当2个文件的md5一致时,切没有-a(--all)参数时,不做复制文件操作,这样可忽略2个文件修改时间不一致的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
breath-co2 committed Mar 29, 2013
1 parent 0a541be commit fecdcc0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/svn-tools
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ Examples:
$to = realpath($to) . '/';

$this->glob_dir($from, $to);

echo "\nall done.\n";
}

private function glob_dir($from, $to)
Expand Down Expand Up @@ -968,6 +970,12 @@ Examples:

if (is_file($to_file))
{
if (!$this->is_all && md5_file($to_file)==md5_file($file))
{
# 不是完整复制,且md5一样就不复制
continue;
}

if (@copy($file, $to_file))
{
echo "C $to_file\n";
Expand Down

0 comments on commit fecdcc0

Please sign in to comment.