1 |
Author: zmedico |
2 |
Date: 2008-11-26 06:24:25 +0000 (Wed, 26 Nov 2008) |
3 |
New Revision: 12094 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/repoman |
7 |
Log: |
8 |
Bug #248464 - With git, there's never any keyword expansion, so there's |
9 |
no need to regenerate manifests and all files will be committed in one |
10 |
big commit at the end. |
11 |
|
12 |
|
13 |
Modified: main/trunk/bin/repoman |
14 |
=================================================================== |
15 |
--- main/trunk/bin/repoman 2008-11-26 00:42:05 UTC (rev 12093) |
16 |
+++ main/trunk/bin/repoman 2008-11-26 06:24:25 UTC (rev 12094) |
17 |
@@ -1795,8 +1795,16 @@ |
18 |
if myout[0] == 0: |
19 |
myheaders.append(myfile) |
20 |
|
21 |
- print "*",green(str(len(myupdates))),"files being committed...",green(str(len(myheaders))),"have headers that will change." |
22 |
- print "*","Files with headers will cause the manifests to be made and recommited." |
23 |
+ print "* %s files being committed..." % green(str(len(myupdates))), |
24 |
+ if vcs == 'git': |
25 |
+ # With git, there's never any keyword expansion, so there's |
26 |
+ # no need to regenerate manifests and all files will be |
27 |
+ # committed in one big commit at the end. |
28 |
+ print |
29 |
+ else: |
30 |
+ print "%s have headers that will change." % green(str(len(myheaders))) |
31 |
+ print "* Files with headers will cause the " + \ |
32 |
+ "manifests to be made and recommited." |
33 |
logging.info("myupdates:", str(myupdates)) |
34 |
logging.info("myheaders:", str(myheaders)) |
35 |
|
36 |
@@ -1844,7 +1852,7 @@ |
37 |
commitmessage += ", RepoMan options: --force" |
38 |
commitmessage += ")" |
39 |
|
40 |
- if myupdates or myremoved: |
41 |
+ if vcs != 'git' and (myupdates or myremoved): |
42 |
myfiles = myupdates + myremoved |
43 |
if not myheaders and "sign" not in repoman_settings.features: |
44 |
myfiles += mymanifests |
45 |
@@ -1937,7 +1945,7 @@ |
46 |
write_atomic(x, "".join(mylines)) |
47 |
|
48 |
manifest_commit_required = True |
49 |
- if myupdates or myremoved or mynew: |
50 |
+ if vcs != 'git' and (myupdates or myremoved or mynew): |
51 |
myfiles=myupdates+myremoved+mynew |
52 |
for x in range(len(myfiles)-1, -1, -1): |
53 |
if myfiles[x].count("/") < 4-repolevel: |
54 |
@@ -2059,8 +2067,14 @@ |
55 |
portage.writemsg("!!! Disabled FEATURES='sign'\n") |
56 |
signed = False |
57 |
|
58 |
- if manifest_commit_required or signed: |
59 |
+ if vcs == 'git' or manifest_commit_required or signed: |
60 |
|
61 |
+ myfiles = mymanifests[:] |
62 |
+ if vcs == 'git': |
63 |
+ myfiles += myupdates |
64 |
+ myfiles += myremoved |
65 |
+ myfiles.sort() |
66 |
+ |
67 |
fd, commitmessagefile = tempfile.mkstemp(".repoman.msg") |
68 |
mymsg = os.fdopen(fd, "w") |
69 |
mymsg.write(commitmessage) |
70 |
@@ -2075,7 +2089,7 @@ |
71 |
commit_cmd.append("commit") |
72 |
commit_cmd.extend(vcs_local_opts) |
73 |
commit_cmd.extend(["-F", commitmessagefile]) |
74 |
- commit_cmd.extend(f.lstrip("./") for f in mymanifests) |
75 |
+ commit_cmd.extend(f.lstrip("./") for f in myfiles) |
76 |
|
77 |
try: |
78 |
if options.pretend: |