- º°µµÀÇ µð·ºÅ丮¿¡ ÀÖ´Â ÀÛ¾÷º»°ú µðÆÌ ºñ±³Çؼ º¯°æ »çÇ× Àû¿ëÇϱâ
- ƯÁ¤ Changelist ¾È¿¡ ÀÖ´Â ÆÄÀÏµé ¸ðµÎ ·Ñ¹éÇϱâ
- ÆÄÀÏ ·Ñ¹éÇϱâ
- ÆÄÀÏ Å¸ÀÔ ¸ÅÇÎ Àμö
- µð·ºÅ丮 ¾ÈÀÇ ¸ðµç ÆÄÀÏ Ãß°¡Çϱâ
1 º°µµÀÇ µð·ºÅ丮¿¡ ÀÖ´Â ÀÛ¾÷º»°ú µðÆÌ ºñ±³Çؼ º¯°æ »çÇ× Àû¿ëÇϱâ
dirdiff ºñ½ÁÇÑ ³»¿ë. ¼Ò½ºº¸´Ù´Â µ¥ÀÌÅÍ ÆÄÀÏ °ü¸®¸¦ À§ÇØ ÇÊ¿äÇÏ´Ù. add/edit´Â ÇÑ ÇÔ¼ö ¾È¿¡¼ ó¸®ÇÒ ¼ö ÀÖ´Ù¸¸, ±×³É ±ò²ûÇÏ°Ô ºÐ¸®Çß´Ù.
require 'fileutils'
require 'zlib'
# ÀÛ¾÷ µð·ºÅ丮 ·çÆ® (ÆÛÆ÷½º¿Í °ü·Ã¾ø´Â µð·ºÅ丮)
$WORKSPACE_ROOT = "depot"
# ÆÛÆ÷½º ¿öÅ©½ºÆäÀ̽º
$DEPOT_ROOT = "working"
# ·çÆ® ¾Æ·¡¿¡¼ ºñ±³ÇÒ µð·ºÅ丮µé
$DIRECTORIES = ["data"]
# »èÁ¦ÇÒ ÆÄÀÏ Ã¼Å©µµ ¼öÇàÇÒ °ÍÀΰ¡?
$SCAN_FOR_DELETE = false
# CRC32 üũ
def is_same_file(lhs_name, rhs_name)
if File.size(lhs_name) == File.size(rhs_name) then
lhs_file = File.new(lhs_name, 'r')
rhs_file = File.new(rhs_name, 'r')
result = true
while not lhs_file.eof? do
if Zlib::crc32(lhs_file.read(1024)) != Zlib::crc32(rhs_file.read(1024)) then
result = false
break
end
end
lhs_file.close
rhs_file.close
return result
else
return false
end
end
# µðÆÌ¿¡¼ »èÁ¦ÇؾßÇÒ ÆÄÀÏµé °Ë»ö
# (µðÆÌ¿¡´Â ÀÖÁö¸¸ ·ÎÄÿ¡¼´Â »èÁ¦µÈ ÆÄÀϵé)
def compare_for_delete(depot_path, working_path, bat_file)
Dir.foreach(depot_path) { |name|
next if name == '.' or name == '..'
depot_full_name = File.join(depot_path, name)
working_full_name = File.join(working_path, name)
case File.ftype(depot_full_name)
when "file"
if File.exists?(working_full_name) == false then
command = "p4 revert \"" + depot_full_name + "\"\n"
command += "p4 delete \"" + depot_full_name + "\"\n"
command = command.gsub("/", "\\")
command = command.gsub(" \\y ", " /y ")
bat_file.write(command)
end
when "directory"
compare_for_delete(depot_full_name, working_full_name, bat_file)
end
}
end
# µðÆÌ¿¡´Ù Ãß°¡ÇؾßÇÒ ÆÄÀÏµé °Ë»ö
# (·ÎÄÿ¡´Â ÀÖÁö¸¸ µðÆÌ¿¡´Â ¾ø´Â ÆÄÀϵé)
def compare_for_add(depot_path, working_path, bat_file)
if not File.exists?(depot_path) then
return
end
if not File.exists?(working_path) then
return
end
Dir.foreach(working_path) { |name|
next if name == '.' or name == '..'
working_full_name = File.join(working_path, name)
depot_full_name = File.join(depot_path, name)
case File.ftype(working_full_name)
when "file"
if not File.exists?(depot_full_name) then
command = "copy /y \"" + working_full_name + "\" \"" + depot_full_name + "\"\n"
command += "p4 add \"" + depot_full_name + "\"\n"
command = command.gsub("/", "\\")
command = command.gsub(" \\y ", " /y ")
bat_file.write(command)
end
when "directory"
compare_for_add(depot_full_name, working_full_name, bat_file)
end
}
end
# º¯°æµÈ ÆÄÀÏµé °Ë»ö
# (·ÎÄÃ, µðÆÌ ¸ðµÎ¿¡ ÀÖÀ¸³ª ¼öÁ¤ ³¯Â¥°¡ ´Ù¸¥ ÆÄÀϵé)
def compare_for_edit(depot_path, working_path, bat_file)
if not File.exists?(depot_path) then
return
end
if not File.exists?(working_path) then
return
end
Dir.foreach(working_path) { |name|
next if name == '.' or name == '..'
working_full_name = File.join(working_path, name)
depot_full_name = File.join(depot_path, name)
case File.ftype(working_full_name)
when "file"
if File.exists?(depot_full_name) and is_same_file(working_full_name, depot_full_name) == false then
command = "p4 edit \"" + depot_full_name + "\"\n"
command += "copy /y \"" + working_full_name + "\" \"" + depot_full_name + "\"\n"
command = command.gsub("/", "\\")
command = command.gsub(" \\y ", " /y ")
bat_file.write(command)
end
when "directory"
compare_for_edit(depot_full_name, working_full_name, bat_file)
end
}
end
bat_file = File.open("execute.bat", "w")
bat_file.write("@echo off\n")
for dir in $DIRECTORIES do
depot = File.join($DEPOT_ROOT, dir)
workspace = File.join($WORKSPACE_ROOT, dir)
if $SCAN_FOR_DELETE then
compare_for_delete(depot, workspace, bat_file)
end
compare_for_add(depot, workspace, bat_file)
compare_for_edit(depot, workspace, bat_file)
end
bat_file.write("pause\n")
2 ƯÁ¤ Changelist ¾È¿¡ ÀÖ´Â ÆÄÀÏµé ¸ðµÎ ·Ñ¹éÇϱâ
3 ÆÄÀÏ ·Ñ¹éÇϱâ
P4WINÀ» »ç¿ëÇÏ´Â °æ¿ì´Ù.
- ·Ñ¹éÇϱ⠿øÇÏ´Â ÆÄÀÏÀ» ¼±ÅÃÇÑ´Ù. (»èÁ¦µÈ ÆÄÀÏÀ» º¹±¸ÇÏ·Á´Â °ÍÀ̶ó¸é, View ¸Þ´º¿¡¼ "Show deleted depot files"¸¦ ¼±ÅÃÇÑ´Ù.)
- ¿À¸¥ÂÊ Å¬¸¯Çؼ, Revision History¸¦ ¼±ÅÃÇÑ´Ù.
- º¹±¸Çϱ⠿øÇÏ´Â ¸®ºñÀüÀ» ¼±ÅÃÇϰí, Sync ¹öưÀ» Ŭ¸¯ÇÑ´Ù. ±× ´ÙÀ½ Revision History ´ëÈâÀ» ´Ý´Â´Ù.
- ÆÄÀÏÀ» ÆíÁý¿ëÀ¸·Î ¿¬´Ù. ¾î´À ¹öÀüÀ» ¿øÇÏ´À³Ä°í ÆÛÆ÷½º°¡ ¹°¾îº¼ °ÍÀÌ´Ù. "Edit Current"¸¦ ¼±ÅÃÇÑ´Ù. ¾Æ´Ï¸é Çìµå ¸®ºñÀüÀ̶û ½ÌÅ©°¡ µÇ¾î¹ö¸°´Ù.
- üÀÎÁö¸®½ºÆ®¿¡¼ ´ë»ó ÆÄÀÏÀ» ã´Â´Ù.
- ÆÄÀÏÀ» ¿À¸¥ÂÊ Å¬¸¯ÇÏ¸é ¸Þ´º°¡ ³ª¿À´Âµ¥, Resolve -> Schedule file for resolve¸¦ ¼±ÅÃÇÑ´Ù.
- ´Ù½Ã Resolve -> Resolve¸¦ ¼±ÅÃÇÑ´Ù.
- Resolve ´ëÈâ¿¡¼ Accept yours¸¦ ¼±ÅÃÇÑ ´ÙÀ½, OK¸¦ ´©¸¥´Ù.
- º¯°æµÈ ÆÄÀÏÀ» ¼ºê¹ÔÇÑ´Ù.
4 ÆÄÀÏ Å¸ÀÔ ¸ÅÇÎ Àμö
p4 typemap ¸í·É¾î¿¡ »ç¿ëÇÏ´Â ÀÎÀÚµé. p4 help filetypes ÇÏ¸é ³ª¿À´Â ³»¿ëµéÀÌ´Ù. Á» ´õ ÀÚ¼¼ÇÑ ³»¿ëÀº
¿©±â¸¦ Âü°í...
base filetypes
| Type | Client Use | Server Storage |
| text | newlines translated | deltas in RCS format |
| binary | raw bytes | compressed binary |
| symlink | symbolic link | deltas in RCS format |
| apple | Mac resource + data | compressed AppleSingle |
| resource | Mac resource fork | compressed binary |
| unicode | newlines translated | deltas in RCS format stored as UTF-8 |
modifiers
| Modifier | Meaning |
| +m | always set modtime on client (overrides client's nomodtime) |
| +w | always writable on client |
| +x | exec bit set on client |
| +k | $Keyword$ expansion of Id, Header, Author, Date, DateTime, Change, File, Revision |
| +ko | $Keyword$ expansion of Id, Header only |
| +l | exclusive open: disallow multiple opens |
| +C | server stores compressed file per revision |
| +D | server stores deltas in RCS format |
| +F | server stores full file per revision |
| +S | server stores only single head revision |
5 µð·ºÅ丮 ¾ÈÀÇ ¸ðµç ÆÄÀÏ Ãß°¡Çϱâ
dir /b /s /a-d | p4 -x - add
SeriousMoin v1 (koMoinMoin 1.0a4 Modified)