1 |
Author: zmedico |
2 |
Date: 2008-12-03 08:23:34 +0000 (Wed, 03 Dec 2008) |
3 |
New Revision: 12143 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/bin/repoman |
7 |
Log: |
8 |
It's not safe to use the git commit -a option since there might |
9 |
be some modified files elsewhere in the working tree that the |
10 |
user doesn't want to commit. Therefore, call git update-index |
11 |
in order to ensure that the index is updated with the latest |
12 |
versions of all new and modified files in the relevant portion |
13 |
of the working tree. (trunk r12142) |
14 |
|
15 |
|
16 |
Modified: main/branches/2.1.6/bin/repoman |
17 |
=================================================================== |
18 |
--- main/branches/2.1.6/bin/repoman 2008-12-03 08:22:10 UTC (rev 12142) |
19 |
+++ main/branches/2.1.6/bin/repoman 2008-12-03 08:23:34 UTC (rev 12143) |
20 |
@@ -1764,6 +1764,8 @@ |
21 |
mymanifests.add(f) |
22 |
else: |
23 |
myupdates.add(f) |
24 |
+ if vcs == 'git': |
25 |
+ myupdates.difference_update(myremoved) |
26 |
myupdates = list(myupdates) |
27 |
mymanifests = list(mymanifests) |
28 |
myheaders = [] |
29 |
@@ -2058,6 +2060,27 @@ |
30 |
portage.writemsg("!!! Disabled FEATURES='sign'\n") |
31 |
signed = False |
32 |
|
33 |
+ if vcs == 'git': |
34 |
+ # It's not safe to use the git commit -a option since there might |
35 |
+ # be some modified files elsewhere in the working tree that the |
36 |
+ # user doesn't want to commit. Therefore, call git update-index |
37 |
+ # in order to ensure that the index is updated with the latest |
38 |
+ # versions of all new and modified files in the relevant portion |
39 |
+ # of the working tree. |
40 |
+ myfiles = mymanifests + myupdates |
41 |
+ myfiles.sort() |
42 |
+ update_index_cmd = ["git", "update-index"] |
43 |
+ update_index_cmd.extend(f.lstrip("./") for f in myfiles) |
44 |
+ if options.pretend: |
45 |
+ print "(%s)" % (" ".join(update_index_cmd),) |
46 |
+ else: |
47 |
+ retval = spawn(update_index_cmd, env=os.environ) |
48 |
+ if retval != os.EX_OK: |
49 |
+ writemsg_level(("!!! Exiting on %s (shell) " + \ |
50 |
+ "error code: %s\n") % (vcs, retval), |
51 |
+ level=logging.ERROR, noiselevel=-1) |
52 |
+ sys.exit(retval) |
53 |
+ |
54 |
if vcs == 'git' or manifest_commit_required or signed: |
55 |
|
56 |
myfiles = mymanifests[:] |