Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git p4: rearrange self.initialParent use
author
Pete Wyckoff
<pw@padd.com>
Tue, 15 Jan 2013 00:47:04 +0000
(19:47 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 15 Jan 2013 17:46:30 +0000
(09:46 -0800)
This was set in a couple of places, both of which were very
far away from its use. Move it a bit closer to importChanges(),
and add some comments.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
40d69ac
)
diff --git
a/git-p4.py
b/git-p4.py
index 2d0b58f0b450dcd8ab2009d2e03e3ba6fcfbc4fc..2924496cd40e0ff3c8e8b1315162f5abd4fd898a 100755
(executable)
--- a/
git-p4.py
+++ b/
git-p4.py
@@
-2683,6
+2683,7
@@
def importChanges(self, changes):
files = self.extractFilesFromCommit(description)
self.commit(description, files, self.branch,
self.initialParent)
files = self.extractFilesFromCommit(description)
self.commit(description, files, self.branch,
self.initialParent)
+ # only needed once, to connect to the previous commit
self.initialParent = ""
except IOError:
print self.gitError.read()
self.initialParent = ""
except IOError:
print self.gitError.read()
@@
-2748,7
+2749,6
@@
def importHeadRevision(self, revision):
def run(self, args):
self.depotPaths = []
self.changeRange = ""
def run(self, args):
self.depotPaths = []
self.changeRange = ""
- self.initialParent = ""
self.previousDepotPaths = []
self.hasOrigin = False
self.previousDepotPaths = []
self.hasOrigin = False
@@
-2836,8
+2836,6
@@
def run(self, args):
if p4Change > 0:
self.depotPaths = sorted(self.previousDepotPaths)
self.changeRange = "@%s,#head" % p4Change
if p4Change > 0:
self.depotPaths = sorted(self.previousDepotPaths)
self.changeRange = "@%s,#head" % p4Change
- if not self.detectBranches:
- self.initialParent = parseRevision(self.branch)
if not self.silent and not self.detectBranches:
print "Performing incremental import into %s git branch" % self.branch
if not self.silent and not self.detectBranches:
print "Performing incremental import into %s git branch" % self.branch
@@
-2982,6
+2980,14
@@
def run(self, args):
self.updatedBranches = set()
self.updatedBranches = set()
+ if not self.detectBranches:
+ if args:
+ # start a new branch
+ self.initialParent = ""
+ else:
+ # build on a previous revision
+ self.initialParent = parseRevision(self.branch)
+
self.importChanges(changes)
if not self.silent:
self.importChanges(changes)
if not self.silent: