Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6bb4a51d
Kaydet (Commit)
6bb4a51d
authored
Nis 28, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implemented action() now, plus some bug fixes
üst
b07d729c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
5 deletions
+53
-5
rcvs.py
Demo/pdist/rcvs.py
+53
-5
No files found.
Demo/pdist/rcvs.py
Dosyayı görüntüle @
6bb4a51d
...
@@ -23,14 +23,59 @@ class MyFile(File):
...
@@ -23,14 +23,59 @@ class MyFile(File):
'A' -- new locally
'A' -- new locally
'R' -- deleted locally
'R' -- deleted locally
'U' -- changed remotely, no changes locally
'U' -- changed remotely, no changes locally
(includes new remotely or deleted remotely)
'M' -- changed locally, no changes remotely
'M' -- changed locally, no changes remotely
'C' -- conflict: changed locally as well as remotely
'C' -- conflict: changed locally as well as remotely
(includes cases where the file has been added
(includes cases where the file has been added
or removed locally and remotely)
or removed locally and remotely)
'r' -- get rid of entry
'c' -- create entry
'u' -- update entry
"""
"""
if
not
self
.
eseen
:
if
not
self
.
eseen
:
pass
if
not
self
.
lseen
:
return
'?'
if
not
self
.
rseen
:
return
'0'
# Never heard of
else
:
return
'N'
# New remotely
else
:
# self.lseen
if
not
self
.
rseen
:
return
'?'
# Local only
# Local and remote, but no entry
if
self
.
lsum
==
self
.
rsum
:
return
'c'
# Restore entry only
else
:
return
'C'
# Real conflict
else
:
# self.eseen
if
not
self
.
lseen
:
if
self
.
eremoved
:
if
self
.
rseen
:
return
'R'
# Removed
else
:
return
'r'
# Get rid of entry
else
:
# not self.eremoved
if
self
.
rseen
:
print
"warning:"
,
print
self
.
file
,
print
"was lost"
return
'U'
else
:
return
'r'
# Get rid of entry
else
:
# self.lseen
if
not
self
.
rseen
:
if
self
.
enew
:
return
'A'
# New locally
else
:
return
'D'
# Deleted remotely
else
:
# self.rseen
if
self
.
enew
:
if
self
.
lsum
==
self
.
rsum
:
return
'u'
else
:
return
'C'
if
self
.
lsum
==
self
.
esum
:
if
self
.
esum
==
self
.
rsum
:
return
'='
else
:
return
'U'
elif
self
.
esum
==
self
.
rsum
:
return
'M'
elif
self
.
lsum
==
self
.
rsum
:
return
'u'
else
:
return
'C'
def
update
(
self
):
def
update
(
self
):
code
=
self
.
action
()
code
=
self
.
action
()
...
@@ -127,7 +172,8 @@ class rcvs(CommandFrameWork):
...
@@ -127,7 +172,8 @@ class rcvs(CommandFrameWork):
files
=
[]
files
=
[]
if
self
.
cvs
.
checkfiles
(
files
):
if
self
.
cvs
.
checkfiles
(
files
):
return
1
return
1
self
.
cvs
.
report
()
for
file
in
files
:
print
self
.
cvs
.
entries
[
file
]
.
action
(),
file
def
do_update
(
self
,
opts
,
files
):
def
do_update
(
self
,
opts
,
files
):
"""update [file] ..."""
"""update [file] ..."""
...
@@ -138,6 +184,7 @@ class rcvs(CommandFrameWork):
...
@@ -138,6 +184,7 @@ class rcvs(CommandFrameWork):
print
"
%
s: not found"
%
file
print
"
%
s: not found"
%
file
else
:
else
:
self
.
cvs
.
entries
[
file
]
.
update
()
self
.
cvs
.
entries
[
file
]
.
update
()
self
.
cvs
.
putentries
()
def
do_commit
(
self
,
opts
,
files
):
def
do_commit
(
self
,
opts
,
files
):
"""commit [file] ..."""
"""commit [file] ..."""
...
@@ -145,13 +192,14 @@ class rcvs(CommandFrameWork):
...
@@ -145,13 +192,14 @@ class rcvs(CommandFrameWork):
return
1
return
1
sts
=
0
sts
=
0
for
file
in
files
:
for
file
in
files
:
if
not
self
.
entries
[
file
]
.
commitcheck
():
if
not
self
.
cvs
.
entries
[
file
]
.
commitcheck
():
sts
=
1
sts
=
1
if
sts
:
if
sts
:
return
sts
return
sts
message
=
raw_input
(
"One-liner: "
)
message
=
raw_input
(
"One-liner: "
)
for
file
in
files
:
for
file
in
files
:
self
.
entries
[
file
]
.
commit
(
message
)
self
.
cvs
.
entries
[
file
]
.
commit
(
message
)
self
.
cvs
.
putentries
()
def
main
():
def
main
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment