From 79c04b04d2bf4c095f646004707198e746ca481b Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 14 Mar 2016 22:53:55 +0000 Subject: [PATCH] Cleaning the code: Quitting support for Fossil repositories. It was not working. PAY PARTICULAR ATTENTION. --- .../Grafoscopio/GrafoscopioBrowser.class.st | 129 +----------------- 1 file changed, 4 insertions(+), 125 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index f9ee852..63a22cb 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -567,25 +567,6 @@ GrafoscopioBrowser class >> updateUI [ self startDockingBar. ] -{ #category : #'persistance / repositories' } -GrafoscopioBrowser >> addFileToRepository [ - "Adds a selected file to a defined repository." - - | fileStream fileToAdd | - - self buildBrowser. - fileStream := UITheme builder - fileOpen: 'Elija un archivo para agregar al repositorio'. - - fileStream isNil ifTrue: [ ^nil ]. - fileToAdd := fileStream fullName. - OSProcess command: - 'cd ', (mainTree metadata at: 'localRepository') asFileReference parent fullName, '; ', - fossil, ' add ', fileToAdd, '; ', - 'echo "Added file to enabled repository"'. - self inform: 'Archivo adicionado al repositorio' -] - { #category : #tags } GrafoscopioBrowser >> addTagTo: aNode [ "Tags the node passed as argument with a value from the collection of tags available" @@ -634,7 +615,7 @@ GrafoscopioBrowser >> bodyForCodeIn: constructor for: aNode [ GrafoscopioBrowser >> bodyIn: constructor [ "Shows the body of a selected node" - (constructor text) + (constructor text asString) title: 'Texto'; format:[:eachNode | (eachNode body) isNil @@ -711,21 +692,6 @@ browser transformed: [:node :text | node header: text asString] ] -{ #category : #'graphical interface' } -GrafoscopioBrowser >> buildBrowserLandscape [ - -browser := GLMTabulator new - title: 'Grafoscopio'. -browser - column: #original span: 3; - column: #transmediado span: 3. -browser - updateOn: GLMItemAdded from: #yourself; - updateOn: GLMItemRemoved from: #yourself. - - -] - { #category : #'graphical interface' } GrafoscopioBrowser >> buildBrowserNamed: aName [ "Main method for building the interface for trees and its nodes. The name of the browser corresponds to the name of the file @@ -756,7 +722,7 @@ browser when: [:selection | selection notNil]; andShow: [ :a :node | self bodyIn: a for: node. - self bodyForCodeIn: a for: node]. + self bodyForCodeIn: a for: node ]. (browser transmit ) from: #tree port: #selection; from: #nodeBody port: #text; @@ -765,7 +731,7 @@ browser transformed: [:node :content | node tags = 'código' ifFalse: [node body: content asString] - ifTrue: [node body: content asString]]. + ifTrue: [node body: content string "text asString"]]. (browser transmit) from: #tree; to: #nodeHeader; @@ -778,25 +744,6 @@ browser transformed: [:node :text | node header: text asString] ] -{ #category : #'persistance / repositories' } -GrafoscopioBrowser >> commitToRepository [ - "Commits to the associated repository for the current document tree. - REFACTORING NOTE: A more interactive use of external OS process, using pipeable os process should be done - allowing to capture console message." - | commitMessage | - commitMessage := UIManager default - textEntry: 'Ingrese el mensaje asociado a este envío al historial' - title: 'Mensaje para el historial'. - commitMessage isNil ifTrue: [ ^nil ]. - (mainTree metadata at: 'localRepository') notNil - ifTrue: [ - OSProcess command: - 'cd ', (mainTree metadata at: 'localRepository') asFileReference parent fullName, '; ', - fossil, ' commit --no-warnings -m "', commitMessage, '"; ', - 'echo "commit sended to the repository"'. - self inform: 'Histórico del proyecto sincronizado'] -] - { #category : #'system-support' } GrafoscopioBrowser >> configureInitialTags [ "Configures a list of predefined tags available to use. More tags should be added from a repository. @@ -844,56 +791,6 @@ GrafoscopioBrowser >> customKeys [ stream nextPutAll: bibStream contents withUnixLineEndings ]]. ] -{ #category : #'persistance / repositories' } -GrafoscopioBrowser >> defineRemoteRepository [ - "Defines a remote fossil repository from an url" - - | remoteRepoUrl localRepoDirectory | - "remoteRepoUrl := UIManager default - textEntry: 'Ingrese la dirección web del repositorio remoto' - title: 'Dirección web del repositorio'." - remoteRepoUrl := 'http://hackbo.co/deltas/repos.fossil/reco2/'. - localRepoDirectory := FileLocator documents asFileReference / 'ReCo2'. - localRepoDirectory ensureCreateDirectory. - mainTree metadata ifNil: [mainTree metadata: Dictionary new]. - mainTree metadata - at: 'remoteRepository' put: remoteRepoUrl; - at: 'localRepository' put: (localRepoDirectory / 'reco2.fossil') fullName. - OS2Process command: - 'cd ', localRepoDirectory asFileReference fullName, '; ', - fossil, ' clone ', remoteRepoUrl, ' reco2.fossil; ', - 'echo "Repositorio clonado"'. - (localRepoDirectory / '.fslckout') exists ifFalse: [ - OS2Process command: - 'cd ', localRepoDirectory asFileReference fullName, '; ', - fossil, ' open reco2.fossil; ', - 'echo "Repositorio clonado"']. - self inform: 'Repositorio remoto definido y activado'. -] - -{ #category : #'persistance / repositories' } -GrafoscopioBrowser >> enableLocalRepository [ - "Just a temporary message to enable working with fossil on a specific repository. This should be generalized" - - | fileStream | - - fileStream := UITheme builder - fileOpen: 'Coloque la ruta al repositorio del proyecto (.fossil)' - extensions: #('fossil'). - fileStream isNil ifTrue: [ ^nil ]. - localRepository := fileStream name asFileReference. - mainTree metadata ifNil: [mainTree metadata: Dictionary new]. - mainTree metadata at: 'localRepository' put: fileStream name. - (Smalltalk platform name = 'unix') | (Smalltalk platform name = 'Mac OS') - ifTrue: [ - OSProcess command: - 'cd ', localRepository parent fullName,';', - 'exec ', fossil, ' open ', localRepository fullName]. - self inform: - 'Repositorio local activado: ', Character cr, - (mainTree metadata at: 'localRepository') -] - { #category : #persistence } GrafoscopioBrowser >> exportAsHtml [ "Exports the current tree to HTML, using the same name but different extension (.html)" @@ -1118,16 +1015,6 @@ GrafoscopioBrowser >> openHelpInGrafoscopio [ browser openOn: mainTree children. ] -{ #category : #'as yet unclassified' } -GrafoscopioBrowser >> openLandscape [ - "Opens a new browser with a default tree in landscape mode" - self buildBrowserLandscape. - mainTree := GrafoscopioNode new. - mainTree becomeDefaultTree. - browser openOn: mainTree children. - -] - { #category : #persistence } GrafoscopioBrowser >> openTutorialInGrafoscopio [ "Opens the help tree from a file" @@ -1466,15 +1353,7 @@ GrafoscopioBrowser >> treeOn: constructor [ ]] entitled: 'Desetiquetar nodo como...' categorized: 'Etiquetas'; act: [self showTagsAvailable] entitled: 'Ver disponibles' categorized: 'Etiquetas'; - act: [self addToTagsAvailable] entitled: 'Agregar a disponibles' categorized: 'Etiquetas'; - - "For projects" - act: [self defineRemoteRepository] entitled: 'Activar repositorio remoto...' categorized: 'Proyecto'; - act: [self enableLocalRepository] entitled: 'Activar repositorio local...' categorized: 'Proyecto'; - act: [self addFileToRepository] entitled: 'Agregar archivo...' categorized: 'Proyecto'; - act: [self messageNotImplementedYet] entitled: 'Eliminar archivo...' categorized: 'Proyecto'; - act: [self commitToRepository] entitled: 'Enviar al histórico' categorized: 'Proyecto'; - act: [self messageNotImplementedYet "repositoryCredentials"] entitled: 'Acreditarse' categorized: 'Proyecto'. + act: [self addToTagsAvailable] entitled: 'Agregar a disponibles' categorized: 'Etiquetas'. ] { #category : #persistence }