Added warning about commiting new head to HGCommitDialog.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 28 Nov 2012 09:12:38 +0000
changeset 109 08c6eca6df25
parent 107 c92f7674485e
child 110 591b18c11be9
Added warning about commiting new head to HGCommitDialog.
mercurial/HGCommand.st
mercurial/HGCommitDialog.st
mercurial/HGPackageModel.st
mercurial/abbrev.stc
mercurial/mercurial.rc
--- a/mercurial/HGCommand.st	Tue Nov 27 22:17:24 2012 +0000
+++ b/mercurial/HGCommand.st	Wed Nov 28 09:12:38 2012 +0000
@@ -315,6 +315,12 @@
     "Created: / 15-11-2012 / 00:22:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+pull
+    ^pull new
+
+    "Created: / 27-11-2012 / 23:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 push
     ^push new
 
--- a/mercurial/HGCommitDialog.st	Tue Nov 27 22:17:24 2012 +0000
+++ b/mercurial/HGCommitDialog.st	Wed Nov 28 09:12:38 2012 +0000
@@ -154,6 +154,27 @@
     "Modified: / 16-11-2012 / 11:27:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!HGCommitDialog methodsFor:'private'!
+
+doUpdateWorkingCopy
+    | heads changeset |
+
+    super doUpdateWorkingCopy.
+    heads := self task package workingCopy heads.
+    changeset := self task package workingCopy changeset.
+    (heads includes: changeset) ifFalse:[
+        self infoPanel 
+            reset;
+            beInformation;
+            message: (self resources string:'Comitting a new head.');
+            addButtonWithLabel: (self resources string:'Proceed') action: [self infoPanel hide];
+            addButtonWithLabel: (self resources string:'Cancel') action:[self doCancel];
+            show.
+    ]
+
+    "Created: / 27-11-2012 / 23:36:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !HGCommitDialog class methodsFor:'documentation'!
 
 version_HG
--- a/mercurial/HGPackageModel.st	Tue Nov 27 22:17:24 2012 +0000
+++ b/mercurial/HGPackageModel.st	Wed Nov 28 09:12:38 2012 +0000
@@ -29,6 +29,16 @@
     ^wc repository
 
     "Created: / 15-11-2012 / 09:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+upstreamRepository
+    "Returns original package repository (not the temporary repository)"
+
+    "Stupid naming here..."
+
+    ^repository
+
+    "Created: / 27-11-2012 / 23:22:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGPackageModel methodsFor:'accessing-classes'!
@@ -71,24 +81,30 @@
 ensureWorkingCopy
     "raise an error: must be redefined in concrete subclass(es)"
 
-    | tmpPath tmpRepo tmpWc |
+    | rev tmpPath tmpRepo tmpWc |
 
-    (wc notNil and:[wc path exists]) ifTrue:[ ^ self ].
+    rev := self definition hgLogicalRevision.
+    (wc notNil and:[wc path exists]) ifTrue:[ 
+        wc changeset id ~= rev ifTrue:[
+            wc update:rev.
+        ].
+        ^ self 
+    ].
 
     tmpPath := self manager temporaryWorkingCopyDirectory / repository uuid printString.
     tmpPath exists ifTrue:[
         tmpRepo := HGRepository on: tmpPath.
-        tmpWc := tmpRepo workingCopy.
+        tmpRepo pull.
     ] ifFalse:[
         tmpRepo := repository cloneTo: tmpPath update: false.
-        tmpWc := tmpRepo workingCopy.
-        tmpWc update: self definition hgLogicalRevision.
     ].
+    tmpWc := tmpRepo workingCopy.
+    tmpWc update: rev.
 
     self wc: tmpWc
 
     "Created: / 14-11-2012 / 00:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-11-2012 / 00:37:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-11-2012 / 23:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !HGPackageModel class methodsFor:'documentation'!
--- a/mercurial/abbrev.stc	Tue Nov 27 22:17:24 2012 +0000
+++ b/mercurial/abbrev.stc	Wed Nov 28 09:12:38 2012 +0000
@@ -14,9 +14,9 @@
 HGWorkingCopy HGWorkingCopy stx:libscm/mercurial 'SCM-Mercurial-Core' 0
 HGChangesetId HGChangesetId stx:libscm/mercurial 'SCM-Mercurial-Core' 0
 HGStatus HGStatus stx:libscm/mercurial 'SCM-Mercurial-Core' 1
-HGError HGError stx:libscm/mercurial 'SCM-Mercurial-Exceptions' 1
+HGError HGError stx:libscm/mercurial 'SCM-Mercurial-Core' 1
 HGRepositoryError HGRepositoryError stx:libscm/mercurial 'SCM-Mercurial-Exceptions' 1
-HGCommandError HGCommandError stx:libscm/mercurial 'SCM-Mercurial-Exceptions' 1
+HGCommandError HGCommandError stx:libscm/mercurial 'SCM-Mercurial-Core' 1
 HGCommandParserTests HGCommandParserTests stx:libscm/mercurial 'SCM-Mercurial-Tests' 1
 HGChangeset HGChangeset stx:libscm/mercurial 'SCM-Mercurial-Core' 0
 HGPackageModel HGPackageModel stx:libscm/mercurial 'SCM-Mercurial-StX' 0
--- a/mercurial/mercurial.rc	Tue Nov 27 22:17:24 2012 +0000
+++ b/mercurial/mercurial.rc	Wed Nov 28 09:12:38 2012 +0000
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Jan Vrany 2012\0"
       VALUE "ProductName", "Smalltalk/X Mercurial Integration\0"
       VALUE "ProductVersion", "6.2.3.1\0"
-      VALUE "ProductDate", "Tue, 27 Nov 2012 22:16:38 GMT\0"
+      VALUE "ProductDate", "Tue, 27 Nov 2012 23:46:46 GMT\0"
     END
 
   END